A government in which a nation which had a king elected the man who was to exercise the royal authority, seems quite extraordinary ; but independently of the circumstances they found themselves in, I think the Franks took their ideas on this matter from the distant past.
They had descended from the Germans, of whom Tacitus says that in their choice of king they decided by his nobility ; and in the choice of their chief by his virtue.  There you have the kings of the first dynasty, and the mayors of the palace ; the first ones were hereditary, the second ones elective.
We cannot doubt that these princes, who in the assembly of the nation rose and proposed themselves as chiefs of some enterprise to all who wished to follow them, combined for the most part in their person both the authority of the king and the power of the mayor. Their nobility had given them royalty, and their virtue, by leading numerous volunteers to follow them who were taking them as chiefs, gave them the power of mayor. It is by the royal dignity that our first kings presided over tribunals and assemblies, and issued laws with the consent of those assemblies ; it is by the dignity of duke or chief that they made their expeditions and commanded the armies.
To know the genius of the early Franks in this regard, you have only to look at the conduct of Arbogaste, a Frank by nation, to whom Valentinian had given the command of the army. He closed the emperor in the palace, and allowed no one to speak to him about any matter civil or military.  Arbogaste did then what the Pépins did later.