that anything whatsoever may be commanded. Rather, such a command is regarded as a test and trial: by carrying it out, the servant becomes obedient—as when they were forbidden to drink, except for those who scooped up a single handful.
The correct understanding is that when a command serves as a test and trial, urging an act that contains no benefit in itself, its purpose is achieved once the servant acknowledges the command and resolves to comply, even if he does not perform the act. Such was the case with Abraham when he was commanded to sacrifice his son. Likewise, in the hadith about a bald man, a leper, and a blind man, they were asked to give to a stranded traveller. The leper and the bald man refused and were stripped of their blessings. The blind man, however, offered what was requested, whereupon he was told: “Keep your wealth. You were only being tested. Allah is pleased with you and displeased with your two companions.”
This is the wisdom arising from the command or prohibition itself, rather than from the act itself. A servant may be commanded or forbidden to do something, and the wisdom may lie in his obedience to the command, his submission to it, and his offering what is asked of him. Thus, what was required of Abraham was to place his love for Allah above his love for his son, so that his intimate friendship with Him would be perfected before sacrificing this beloved son for Allah. When he proceeded and his resolve grew firm through his willingness to do so, his love for Allah above his child and all else became a reality. Nothing beloved remained in his heart that rivalled his love for Allah.
Likewise, Saul’s companions were tested by being required to abstain from drinking, so that they might attain the faith and obedience through which compliance is achieved. Here, the test took the form of a prohibition, not a command.
As for stoning the pillars and going between al-Safā and al-Marwah, the act itself is intended because of the remembrance of Allah it contains.