What is the context of revelation for this āyah?
Jibu
Imām Ibn al-Jawzī (d. 597/1201) summarized the scholars' opinions in his book "Zād al-Masīr" as follows:
The Quraysh sent a message to the Prophet (ﷺ) in Madīnah, claiming they had embraced Islam and asking him to send a group of his companions to teach them the religion. The Prophet (ﷺ) sent Khubayb ibn ʿAdī, Marthad al-Ghanawī, Khālid ibn Bukayr, ʿAbdullāh ibn Ṭāriq, and Zayd ibn al-Dathīnah, appointing ʿĀṣim ibn Thābit as their leader. On their way to Makkah, they stopped between Makkah and Madīnah and ate some dates. An old woman saw the date pits, went back to her people, and said, "People from Yathrib (Madīnah) have passed this way." Seventy of them rode out and surrounded them. They fought them, killing Marthad, Khālid, and Ibn Ṭāriq. ʿĀṣim emptied his quiver, killing seven of their leaders with seven arrows. Then he said, "O Allah, I defended Your religion during the daytime, so protect my flesh in the evening." They surrounded and killed him, intending to cut off his head to sell it to Sulāfah bint Saʿd, some of whose family members he had killed. So she had vowed that if she should get his head, she would drink wine from his skull. However, Allah sent a swarm of hornets. They protected his body and they were unable to get a hold of it. When they decided to leave his body until the hornets departed. One of them said, "Leave him until evening." However, a rain cloud came, and rain poured down like from a waterskin. Allah sent a flood in the valley and it carried his body away. Khubayb and Zayd were captured. The Banū al-Ḥārith ibn ʿĀmir bought Khubayb to kill him in revenge, for he had killed their fathers. When they took him out for execution, he asked to pray two rakʿahs, which he did. Then, he said, "If I did not fear you would think I was afraid, I would have prayed longer." He then recited:
I do not care so long as I am Muslim when killed, On whichever side I should fall for Allah's sake That is for the Sake of God and if He wills, He will grant his blessing on the torn-up limbs.
They crucified him alive, whereupon He said, "O Allah, you know there is no one here to deliver my greeting to Your Messenger, so convey to him my greeting." A man called Abū Sirwāʿah approached him with a spear, and placed it on his chest. Khubayb said, "Fear Allah," but this only increased his insolence. As for Zayd, he was bought by Ṣafwān ibn Umayyah to kill him in revenge for his father. Abū Sufyān came to Zayd when he was about to be executed and asked him, "Do you wish that Muḥammad were in your place while you were safe with your family?" Zayd replied, "By Allah, I would not want Muḥammad to be where he is now and then be pricked by a thorn while I am seated with my family." He was then killed.
When the Prophet (ﷺ) heard the news, he asked, "Who will bring Khubayb down from his cross and have Paradise in return?" Al-Zubayr said, "I will, along with my companion al-Miqdād." They set out walking by night and hid by day until they reached the location, where forty intoxicated polytheists were sleeping around the cross. Khubayb's body remained fresh and supple after forty days. Al-Zubayr loaded it on his horse and set out, but they were pursued by seventy men. Al-Zubayr cast Khubayb's body to the ground, and the earth swallowed it up. Al-Zubayr confronted the pursuers, saying, "What has emboldened you against us, O people of Quraysh?" He then revealed his identity, saying, "I am al-Zubayr ibn al-ʿAwwām, and my mother is Ṣafiyyah bint ʿAbd al-Muṭṭalib; my companion is al-Miqdād. We are two watchful lions defending our cub. You can either challenge us, fight, or retreat." They chose to retreat.
The Prophet (ﷺ), who was with Jibrīl at the time, said: "O Muḥammad, the angels are bragging concerning these two from among your companions." Some hypocrites remarked about Khubayb and his companions, "Woe to these killed ones; they neither stayed in their homes nor delivered the message of their companion." Allah revealed this verse and three others regarding al-Zubayr, al-Miqdād, Khubayb, his companions, and the hypocrites.
What is meant by "And he calls Allah to witness as to what is in his heart"?