During the Rightly Guided Caliphate all the Caliphs were selected freely by those who represented the opinion of the Muslims. They were given the Bay’ah (Pledge of Allegiance) on the basis of meritocracy and each of them had huge political experience. Abu Bakr, Umar, Uthman and Ali had all held the position of Wazir (Delegated Assistant) which is the highest government position after the Caliph. When we look to their ages we see they were all elder statesman (excluding Hasan who became Caliph during the civil war).
If we compare this to when the Bay’ah was misapplied and became confined to ruling dynasties as happened after Muawiyah we find a stark contrast in the ages of the Caliphs. This is a characteristic of hereditary rule where the ruler is chosen not on meritocracy but by position in the family. This is why we find instances of very young Caliphs in certain periods of the Caliphate.
For further details please read the article: Will there will be teenage Caliphs in a future Caliphate?