The separation of believers from unbelievers began with the separation of faith from disbelief, which goes back to the very beginning of creation!
When, in the primordial silence of creation, God created the Intellect and tested its obedience and submission, the Intellect became beloved in His presence. Then He created Ignorance, which rebelled instead of obeying and incurred His wrath. God then equipped each of them with seventy-five soldiers. Among the soldiers of the Intellect was faith; its counterpart was disbelief, one of the soldiers of Ignorance. Thus the separation of faith from disbelief began, and every being that sided with faith became a believer, while every being that sided with disbelief became an unbeliever!
فقال أبو عبد الله ع اعرفوا العقل و جنده و الجهل و جنده تهتدوا قال سماعه فقلت جعلت فداک لا نعرف إلا ما عرفتنا فقال أبو عبد الله ع إن الله عز و جل خلق العقل و هو أول خلق من الروحانیین عن یمین العرش من نوره فقال له أدبر فأدبر ثم قال له أقبل فأقبل فقال الله تبارک و تعالى خلقتک خلقا عظیما و کرمتک على جمیع خلقی قال ثم خلق الجهل من البحر الأجاج ظلمانیا فقال له أدبر فأدبر ثم قال له أقبل فلم یقبل فقال له استکبرت فلعنه ثم جعل للعقل خمسه و سبعین جندا فلما رأى الجهل ما أکرم الله به العقل و ما أعطاه أضمر له العداوه فقال الجهل یا رب هذا خلق مثلی خلقته و کرمته و قویته و أنا ضده و لا قوه لی به فأعطنی من الجند مثل ما أعطیته فقال نعم فإن عصیت بعد ذلک أخرجتک و جندک من رحمتی قال قد رضیت فأعطاه خمسه و سبعین جندا فکان مما أعطى العقل من الخمسه و السبعین الجند الخیر و هو وزیر العقل و جعل ضده الشر و هو وزیر الجهل و الإیمان و ضده الکفر و...
Of course, the Realm of the Primordial Covenant came much later than the initial creation!
But the why and how of rebellion and disobedience, despite the initial equality, can be explained as follows:
God, the Almighty, willed that beings should have free will and be able to decide as they wished. This divine will was fulfilled in the case of His servants, who were able to choose for themselves between good and evil, faith and disbelief, and so on.
God has power over all things, including the power to grant His servants the ability to choose as they wish!