The Caliph / Khalifah is successor to a prophet of Allah. His goal is to carry to completion the tasks of reformation and moral guidance which were started by the Prophet.
Allah has promised in Holy Quran to believers and doers of good deed that He would make Caliphs / Khulafa for them:
"Allah had promised to those among you who believe and do good works that He will surely make them Successors in the earth, as He made Successors from among those who were before them; and that He will surely establish for them their religion which He has chosen for them; and that He will surely give them in exchange security and peace after their fear.They will worship Me, and they will not associate anything with Me. Then whoso is ungrateful after that, they will be the rebellious.[chapter Al-Nur]
The verse mentions the blessings attached with righteous Caliphs / Khulafa. After the Holy Prophet (PBUH), the first four Caliphs are called Khulfa-Rashedeen. Hadhrat Abu Bakr, Umer, Uthman and Ali. Hadhrat Ali made a pledge of allegiance to all three previous Caliphs, one after another. They all loved each other.
According to the worldwide (in 200 plus countries) Ahmadiyya movement's claim, their Caliphate / Khilafat has been continuing since 1908. They claim it is according to the prophecy of Holy Prophet Muhammad (PBUH)for peaceful revival of faith with no use of force. The fifth Ahmaddiyya Caliph / Khalifat leads his worldwide community. It is advisory in nature and oversees the morals and spirituality of the followers and has no political objectives at all.