Substitution (badal) can occur in entire clauses just as it does in single words, as in the Almighty’s saying:
“They were afflicting you with the worst torment—slaughtering your sons and sparing your women” (al-Baqarah 2:49).
Here the very acts of slaughtering and sparing constitute the “worst torment.” In like manner, the clause that follows in the ḥadīth is itself the mandated divergence from the idolaters. The fact that the command is first expressed with the phrase “differ from the idolaters” shows that the very principle of differing from them is intended by the Lawgiver; the subsequent specification merely identifies the form that this divergence is to take on this occasion. Stating the general rule before the particular example functions as the rationale—just as one might say, “Honor your guest: feed him and converse with him.” The initial order to honor him makes clear that honoring the guest is required, after which the particular acts that constitute such honor at that moment are named.
The reasoning derived from this ḥadīth is parallel to that drawn from his words: “They do not dye their grey hair, so differ from them.”
Muslim also relates in his Ṣaḥīḥ, on the authority of Abū Hurayrah (may Allah be pleased with him), that the Messenger of Allah—peace and blessings be upon him—said: “Trim the moustaches, let the beards grow, and differ from the Magians.”
By appending the command with this fitting descriptive phrase, the Prophet shows that differing from the Magians is an objective sought by the Lawgiver; it is the operative rationale for this ruling—or at least one of its rationales.