Khilafat is a heavenly institution and is the second manifestation of Divine power, the first being the establishment of prophethood. As it was established once before for the believers, it has been established once again for the true Muslims in this day and age.
Repentance is an Essential Component of the Oath of Allegiance
This is the reality of repentance (which has been mentioned above). But why is repentance an integral part of swearing allegiance to a spiritual guide? The fact of the matter is that man is given to negligence. When an individual takes the oath of allegiance at the hand of one upon whom Allah the Exalted has bestowed this transformed state, the same divine grace and light—that exists in this transformed individual—begins to emerge in the individual just as a graft changes the properties of a tree. The condition, however, is that one should possess a true relationship with this person as though they were a branch attached to his very being; not a lifeless branch. The greater a person’s affinity with this spiritual leader, the better.
(Malfuzat – Volume I, 4)