While the kings commanded the armies, the nation did not think about choosing itself a leader. Clovis and his four sons commanded the French, and led them from victory to victory. Thibault, son of Theodebert, a young prince, weak and ill, was the first of the kings to remain in his palace.  He refused to take an expedition into Italy against Narses, and he had the displeasure of seeing the Franks choose themselves two chiefs who led them there.  Of Clotaire I’s four children, Gontram was the one who most neglected the command of the armies  ; other kings followed this example ; and to discharge the command without peril into other hands, they gave it to several chiefs or dukes. 
From this innumerable difficulties arose : there was no more discipline, no one knew how to obey ; the armies were no longer fearsome except to their own country : they were laden with booty before they arrived in enemy territory. We find a vivid depiction of all these problems in Gregory of Tours.  “How will we be able to obtain the victory,” Gontram would say, “we who do not preserve what our fathers have acquired ? Our nation is no longer the same...”  A curious thing : it had been on the decline since the time of Clovis’s grandsons !
It was therefore natural that the time should come for making a single duke, a duke who could have some authority over that infinite multitude of lords and leudes who no longer knew their responsibilities, a duke who could restore military discipline, and lead against the enemy a nation that no longer knew how to wage war except on itself. They gave the power to the mayors of the palace.
The first function of the mayors of the palace was the economic government of the royal households. They had, in conjunction with other officers, the political government of the fiefs, and at the end they disposed of them by themselves.  They also had the administration of the affairs of war and the command of the armies, and these two functions proved to be necessarily linked to the other two. In those times, it was more difficult to assemble the armies than to command them ; and who better than the person who distributed favors could have that authority ? In this independent and warlike nation it was better to invite than to compel ; it was better to grant or give hope of fiefs that became available by the possessor’s death, reward constantly, make them fear preferences : the person who was superintendent of the palace ought therefore to be the general of the army.