Meaning of the Verse
The verse first teaches the etiquette of not entering the houses of the Prophet ﷺ without permission; if invited to a meal, not to come early and sit waiting for it to be cooked; and once the meal is eaten, to disperse and not stay sitting absorbed in conversation. This used to trouble the Prophet ﷺ, but out of modesty he would say nothing, and Allah is not shy of stating the truth.
Then came the main command: Wa idha sa'altumuhunna mata'an fas'aluhunna min wara'i hijab, that is, when you ask the wives of the Prophet ﷺ for anything, ask them from behind a screen. The verse itself gives the wisdom: Dhalikum atharu li qulubikum wa qulubihinn, that is purer for your hearts and for their hearts. At the end Allah said that it is never permissible to cause hurt to the Messenger of Allah ﷺ or to marry his wives after him; with Allah that is something enormous.
Occasion of Revelation
In Sahih al-Bukhari, Anas (may Allah be pleased with him), who was an eyewitness to the event, relates that after the Prophet ﷺ married Zaynab bint Jahsh (may Allah be pleased with her), he gave a wedding feast. The people ate and left, but three men stayed sitting and talking. The Prophet ﷺ went out and came back, and when they had left, he put a screen between himself and Anas, and this verse was revealed.
Before this, Umar (may Allah be pleased with him) had said: All kinds of people, good and bad, come to you; if only you would command the Mothers of the Believers to observe hijab. Umar counted this among the matters in which revelation came in agreement with his opinion. Also in Sahih al-Bukhari, Aisha (may Allah be pleased with her) relates that one night Sawdah (may Allah be pleased with her) went out to relieve herself, and Umar called out that he had recognised her, as he wished the command of hijab to be revealed; then Allah revealed the command of hijab. All these narrations are authentic and there is no contradiction between them: the wish was expressed earlier, and the revelation came on the day of the wedding feast.
Other Verses About Hijab
The Verse of Hijab is originally about the Mothers of the Believers, but the wisdom stated in it, purity of hearts, is needed by all Muslims. In verse 59 of the same surah, the wives and daughters of the Prophet ﷺ and the believing women were all commanded to draw their outer garments over themselves. In verse 31 of Surah Al-Nur, women are commanded to draw their head coverings over their chests. In Sahih al-Bukhari, Aishah (may Allah be pleased with her) relates that when this verse was revealed, the women of the Muhajirun (Emigrants) tore their sheets and made head coverings from them.
On the basis of these verses, scholars have explained the rulings of a woman's Islamic hijab, and many scholars also use these verses as evidence for covering the face. In Sahih al-Bukhari, Aishah also relates that after the command of hijab came, the Prophet ﷺ told his pure wives that they had been permitted to go out for their needs. The immediate compliance of the female Companions (may Allah be pleased with them) shows that when Allah's command comes, the attitude of a believer is obedience rather than argument.
Key Lessons
Not entering anyone's house without permission, keeping to time when invited, and not troubling the host after the meal are Islamic manners. Avoiding anything that hurts the Prophet ﷺ is a requirement of faith, and respecting the Mothers of the Believers (may Allah be pleased with them) is binding on the Ummah, since they are the mothers of the believers. Hijab is a means of a woman's honour and of the purity of society, not a restriction.