The Carolingians were already in power well before the Arab invasions; they and rival nobles had been struggling over the chief ministership ('Mayor of the Palace') to the increasingly feeble Merovingians since the mid-C7th, and after the victory of Charles Martel's father Pepin of Heristal over his rivals in battle in 687 their control was fixed. But after Pepin died in 714 , outliving his eldest son, the latter's young sons (under the control of their mother and a clique of nobles) and Pepin's illegitimate son Charles Martel fought a civil war, where Charles started out as the underdog but he had won by 719. He then assumed the title of 'Mayor' and control of the Merovingian king, who was by now just a puppet, and kept this status for his lifetime to 741- the royal title was assumed by his son Pepin the Short (Charlemagne's father) only in 751/2, with Papal backing.
Charles' only challenger was the autonomist duke of Aquitaine, which region backed onto Spain to the South so that once the Arabs reached NE Spain and started raiding Roussillon/ Narbonne Aquitaine was at a disadvantage and lost any real chance of being able to resist Charles, let alone overthrow him. (The main landed base of the Carolingians was right up in NE Francia, 'Austrasia' ie the Low Countries and the Rhineland.) The Arabs then overran Aquitaine in their great invasion of 732, though it is unclear if this was just a raid for plunder rather than an attempt at conquest and latter Christian writers may have played up the 'invasion' threat to make Charles' defeat of the invaders at Tours look more heroic and make the Carolingians seem the top defenders of Christendom. The war seems to have wrecked the military capacity of Aquitaine to resist the Carolingians and they has little trouble with it thereafter, though it resisted Pepin in the 760s; possibly the Arab presence and attack in 732 tipped the scales against any autonomist resistance there long-term, but the Carolingians had greater resources so were likely to win in the long term. The prestige from Charles' victory in 732 also brought a higher international reputation to a man seen earlier as a bastard and a usurper, and helped his son Pepin to persuade the Pope to dethrone the Merovingians for him - but the main impetus to that was Papal need of Frankish help against the 'heretic' Iconoclast Byzantine emperor Constantine V and the local Lombards so the Arab factor was a minor one.
It does beg the question, though - had Leo III and Constantine V not turned to Iconoclasm and contradicted Catholic theology on venerating icons of the saints in the 730s-740s, and/or the Byz had a stronger position against the Lombards (who took the Byz HQ in Italy, Ravenna, in 751) , would the Popes have ever called in the Franks to help them in Italy and set the way open for the Frankish conquest of Lombard N Italy in 774 and the crowning of Charlemagne as Emperor in 800? If C is not called into Italy as it's a stable Byz dependency, does he attack Spain instead?