Here, in the context of the migration and the atmosphere of the first armed confrontation between the noble Messenger (saws) and the polytheists, who were his own people, kin, and the people of the Muhajireen (those who migrated) in Mecca, Allah (swt) says:
يَا أَيُّهَا الَّذِينَ آمَنُوا لَا تَتَّخِذُوا آبَاءَكُمْ وَإِخْوَانَكُمْ أَوْلِيَاءَ إِنِ اسْتَحَبُّوا الْكُفْرَ عَلَى الْإِيمَانِ…)) (Oh you who have believed, do not take your fathers or your brothers as allies if they have preferred disbelief over belief): The address is to those who believed and migrated at that time, indicating that allegiance should not be given to the polytheists, even if they were their fathers, brothers or relatives. The true ally is the one to whom a person turns to in all matters, and the disbelieving people should not be chosen for this role.
(…إِنِ اسْتَحَبُّوا الْكُفْرَ عَلَى الْإِيمَانِ ۚ…) (if they have preferred disbelief over belief.): Allah (swt) says (preferred) not (loved) because in this context, the word (preferred) denotes a pretending act of love, while faith is inherent and natural. A person is born with an innate belief in Allah (swt), so when the preference is for disbelief, then there is unnatural act. If they had left the matter to their natural love, desires, and hearts, they would have chosen faith over disbelief.
(…وَمَن يَتَوَلَّهُم مِّنكُمْ فَأُولَٰئِكَ هُمُ الظَّالِمُونَ) (And whoever does so among you – then it is those who are the wrongdoers.): It is because they know about faith, understand the truth, and are aware that Allah (swt) is the Creator and the Sustainer, and He is the one to be obeyed. If they follow the polytheists who worship idols and statues, they would have indeed wronged themselves.