Praise be to Allah, and peace and blessings be upon the Messenger of Allah. To proceed:
At first glance, belief in Allah and the testimony of Tawḥīd may seem to be the same thing. However, the Islamic texts show that the relationship between them depends on the context in which they are mentioned.
In the Hadith of Jibril, Jibril asked the Prophet ﷺ first about Islam and then about faith (Īmān). The Prophet ﷺ explained that:
Therefore, the scholars explained that when Islam and Īmān are mentioned together, each has a specific meaning:
The inward and outward are inseparable. The faith of the heart is not valid without outward actions that reflect it, and outward actions are of no benefit if the heart is devoid of faith.
If the word Īmān is mentioned by itself, it includes the entire religion: belief, speech, and actions.
For this reason, the Prophet ﷺ said to the delegation of ʿAbd al-Qays:
"I command you to have faith in Allah."
He then explained this by mentioning the testimony of faith, prayer, zakāh, and other acts.
Likewise, the Prophet ﷺ said:
"Faith consists of more than seventy branches, the highest of which is saying: 'There is no deity worthy of worship except Allah'..."
Thus, he counted the testimony of faith as one of the branches of Īmān, because when Īmān is mentioned alone, it includes it.
There is no contradiction. Rather, this follows a well-known principle of Ahl al-Sunnah:
In other words, when one term appears independently, it encompasses the whole religion. When both appear together, each carries a specific meaning.
This principle was affirmed by many scholars, including Al-Ismāʿīlī, Al-Khaṭṭābī, Ibn Rajab, and others.
It may be summarized as follows:
Thus, when both terms are mentioned together, Īmān refers primarily to the inward reality, while Islam refers primarily to the outward submission. When either term appears alone, it includes the entire religion.
There is no contradiction between belief in Allah being the first pillar of faith and the testimony that there is no deity worthy of worship except Allah being the first pillar of Islam.
When Islam and Īmān are mentioned together, Īmān relates to the actions of the heart, while Islam relates to outward actions. When either one is mentioned independently, it includes the other, because faith in Islam consists of belief in the heart, affirmation by the tongue, and actions of the limbs, all of which are inseparably connected.
And Allah knows best.