I know that they conquered Spain and part of France, but I’m not really sure why. Was it to gain new territory?
Also, were the invaders actually part of the Algerian/Morrocan(?) army, or were they a rogue group just looking for a place to conquer? In other words, were they a part of the ruling regime, or acting alone?
Moors = Muslim Arabs ( from Arabia and Syria ) and recently converted Muslim Berbers ( from North Africa ) in the service of the Ummayyad dynasty of Damascus. At least in the period you are discussing. The term had a broader meaning later.
There was only a single Muslim polity at the time, the Caliphate. It’s imperial expansion had started earlier under the pre-Ummayyad Caliphs almost by accident when attempts to occupy areas of traditional Arab concern in Syria and the Gulf met with such weak resistance from the exhausted Byzantine and Persian states, that their conquests soon began to snowball. The immense wealth generated by these conquests, the fact that they diverted attention away from internal problems and promoted unity by focusing on a goal, their relative ease, and genuine religious zeal ( reenforced, again, by the ease and scope of Muslim success which seemed to vindicate their faith ) inspired a continuation of Imperial expansion.
France was just where this advance began to run out of steam in the west.
To answer your question, the initial conquest of Spain was launched by Musa ibn Nusayr ( the Tariq ibn Ziyad mentioned in kniz’s link was his lieutenant ), then governor of Ifriqiya ( roughly modern Tunisia and eastern Algeria ). He was later recalled to Damascus and replaced. So these were fully sanctioned invasions, not a bunch of dissidents.
I should add that the Berbers made up the bulk of in the invading forces - Arabs supplied the commanders for the most part. Moors does imply a North African origin, however since those Arab commanders were included indiscrimately under that label, I defined them as above.