How large were the percentage of Muslims in Andalucia compared to in Morocco?
Morroco would be virtually at 90% Islamic, the rest being composed of local or Hispanic Jews.
Andalusia...It's hard to give even a guesstimated proportion, even without taking in account the problem of conversions and conversos (after the conversions of the early XVIth, can we consider moriscos and conversos as Muslims as a whole?).
These were quite important in Aragon (up to 1/3 in some regions) but much more limited in others, except Grenada.
After the reconquest Muslims and Jews were expelled, but I would assume there were quite a few Muslims also in Andalucia.
Actually, the expulision of Moriscos happened later, in the early XVIIth century. At this point they were more or less integrated (it seems that Castillan Moriscos were not only smaller, more assimilated to the overall population, while Valentian did kept their identity including Crypto-Islamism).
Probably many of them moved to Morocco, increasing the percentage of Mulims there.
Actually, only a few did go to Morroco. The country was too divided and troubled to really welcome or organise their arrivals, without mentioning the defiance if not hostility of North African population (remember that Moriscos were converted, even if crypto-Muslims; and that they were culturally really distinct and not integrated into the Berber or Arabo-Berber system) : IOTL many of them were killed in Barbary Coast (while the Sultan did tried to harbour them) that was their main arrival region.
It's not as all Moriscos were crypto-Muslims or particularly pro-Turks as well, a non negligible group settled in Mediterranean France (around 40 000 on 300/400 000 Moriscos) and others managing to stay in Spain basically undisturbed after the expulsions (it's harder to give an estimate, giving the official stance that there wasn't anymore of them. Maybe 10 000)
Depending how well Spain and Catholic powers fare against Protestantism (a failed Reformation would have certainly an impact on the "inner front" perception), Ottomans (Moriscos, critically in Aragon, being seen as a fifth column, not always wrongly), the date, the proportion, basically how expulsions would happen if they did would change greatly. By the XVII, however, I think discoveries of Americas would be done.
Back to the main question : they wouldn't change many things on the local capacity of resistance or unification. The IOTL exemple of Salé Republic, a corsair city-state barely if at all acknowledging Morrocean suzerainty is an exemple.