Let’s go back in time and catch a glimpse of the chain of events-
The verses about the characteristics of the hypocrites were revealed in Al-Madinah, this is because there were no hypocrites in Makkah. Rather the the situation in Makkah was totally opposite- some people were forced to pretend that they were disbelievers for the fear of their lives, while their hearts concealed their faith.
Afterwards, the Messenger of Allah migrated to Al-Madinah, where the Ansar from the tribes of Aws and Khazraj resided. They used to worship idols during the pre-Islamic period of ignorance, just as the rest of the Arab idolators. Three Jewish tribes resided in Al-Madinah, Banu Qaynuqa`-allies of Al-Khazraj, Banu An-Nadir and Banu Qurayzah-allies of the Aws. Many members of the Aws and Khazraj tribes embraced Islam. However, only a few Jews embraced Islam, such as `Abdullah bin Salam.
During the early stage in Al-Madinah, there weren’t any hypocrites because the Muslims were not strong enough to be feared yet. On the contrary, the Messenger of Allah conducted peace treaties with the Jews and several other Arab tribes around Al-Madinah. Soon after, the battle of Badr occurred and Allah gave what we call- a crushing defeat to the pagans of Makkah.
Now here’s the twist in the tale…
`Abdullah bin Ubayy bin Salul was a leader in Al-Madinah. He was Al-Khazraj’s chief, and during the period of Jahiliyyah he was the master of both tribes – Aws and Khazraj. They were about to appoint him their king when the Message reached Al-Madinah, and many in Al-Madinah embraced Islam and also, chose the Prophet as their leader. Ibn Salul’s heart was filled with hatred against Islam and the Muslims- all for the love of power and kingship that was given to the Prophet instead of him. When the battle of Badr took place and Muslims emerged victorious, he said, “Allah’s religion has become apparent.” So he pretended to be Muslim, along with many of those who were just like him, as well as many among the People of the Book. It was then that hypocrisy began in Al-Madinah and among the surrounding nomad tribes.
As for the Emigrants, none of them were hypocrites, since they emigrated willingly (seeking the pleasure of Allah). Rather, when a Muslim would emigrate from Makkah, he would be forced to abandon all of his wealth, offspring and land; he would do so seeking Allah’s reward in the Hereafter.
Source: Tafsir ibn Kathir