The bay’a (pledge of allegiance) is a ruling contract that governs the relationship between the Muslims and the head of the Islamic State. This is shown in the sunnah where the Messenger of Allah ﷺ took bay’a on ruling not belief because bay’a was only taken from mature Muslims.
However, if the bay’a to the Messenger ﷺ was on ruling and not belief then what is the explanation of the bay’a of women (Bay’at al-Nisaa’) mentioned in the Holy Qur’an, where Allah (Most High) says:
يَا أَيُّهَا النَّبِيُّ إِذَا جَاءَكَ الْمُؤْمِنَاتُ يُبَايِعْنَكَ عَلَىٰ أَن لَّا يُشْرِكْنَ بِاللَّهِ شَيْئًا وَلَا يَسْرِقْنَ وَلَا يَزْنِينَ وَلَا يَقْتُلْنَ أَوْلَادَهُنَّ وَلَا يَأْتِينَ بِبُهْتَانٍ يَفْتَرِينَهُ بَيْنَ أَيْدِيهِنَّ وَأَرْجُلِهِنَّ وَلَا يَعْصِينَكَ فِي مَعْرُوفٍ ۙ فَبَايِعْهُنَّ وَاسْتَغْفِرْ لَهُنَّ اللَّهَ ۖ إِنَّ اللَّهَ غَفُورٌ رَّحِيمٌ
“O Prophet! When women who have iman come to you pledging allegiance to you on the grounds that they will not associate anything with Allah or steal or fornicate or kill their children or give a false ascription of paternity – making up lies about their bodies – or disobey you in respect of anything right, then accept their bay’a and ask forgiveness for them. Allah is Ever-Forgiving, Most Merciful.” (Mumtahana, 60:12)
Ustadh Tha’ir Salaamah (Abu Maalik) answers this:
The daleel (textual evidence) is clear that the bay’a to the Messenger ﷺ is a bay’a to him as a head of state and a ruler, i.e. bay’a on ruling not prophethood. So what is the relationship of “that they will not associate anything with Allah or steal or fornicate or kill their children or give a false ascription of paternity – making up lies about their bodies – or disobey you in respect of anything right” with the head of state?
The head of state is responsible for preserving the ‘aqeeda (belief) and preventing kufr ideas from spreading in society. He also protects Muslims from the shubhaat (doubtful thoughts), and gives them awareness through the establishment of educational programs and the like. He works to ensure that there is no legislation other than the revelation which came from Allah Almighty, i.e. he preserves the governance, and breaching the governance is a violation of tawheed, i.e. entry into shirk, which is what is pledged to the Messenger of Allah ﷺ and the rulers after him, as it is not a bay’a on prophethood and imaan. Likewise, the believing women mentioned in the verse pledge “that they will not associate anything with Allah”, and that they will only submit to the rule of Allah. In addition, none of them will become a source for ideas of shirk or promote them, or be carriers of them and they will not carry any thought except what emerges from the Islamic ‘aqeeda.
As for the following things: theft, adultery, killing of children, and the like, it is very clear that they are related to the ruler and the ruling and the one who implements the state’s had (legal limits). So it is a bay’a of obedience to the head of state in matters related to his mandatory ruling powers. Those pledging allegiance, knew that if they breached the limits, the head of state would hold them accountable for it.
The last thing is clear, that they “do not disobey you in respect of anything right”, because obedience does not take place without goodness, and there is no obedience in disobedience to Allah and His Messenger ﷺ. It is an order to obey the head of state who implements Allah’s commands, and many ahadith stipulate obedience not disobedience to the ruler unless he orders a sin. This proves that the whole issue is really related to the bay’a as a method to appoint the head of state. (“The Khilafah and Imamah in Islamic Thought”, p.407)