Al-Imran: 159
"So by a mercy from..."
The ma (in fabi-ma) is added for emphasis, indicating that his gentleness toward them was only by a mercy from Allah, similar to the verse: "So for their breaking of their covenant, We cursed them" (Al-Ma'idah: 13). The meaning of this mercy is that He steadied his heart and granted him success in being gentle and kind to them, even after they had opposed him, disobeyed his command, fled, and abandoned him.
"And had you been harsh..."
Meaning: rude.
"...hard-hearted..."
Meaning: unfeeling.
"...they would have dispersed from around you."
Meaning: they would have scattered away from you until no one remained around you.
"So pardon them..."
Regarding matters that concern you personally.
"...and ask forgiveness for them..."
Regarding matters that concern the right of Allah, to complete your compassion toward them.
"...and consult them in the matter."
Meaning: in matters of war and the like, where no revelation has been sent down to you, so that you may benefit from their opinions and because it serves to soothe their souls and elevate their status.
Al-Hasan (may Allah be pleased with him) said: "Allah knew that he had no need for them, but He wanted those who came after him to follow his example."
The Prophet (peace and blessings be upon him and his family) said: "No people ever consulted one another but they were guided to the most correct of their affairs."
Abu Hurayrah (may Allah be pleased with him) said: "I have never seen anyone who consulted his companions more than the Messenger of Allah (peace and blessings be upon him)." It is said that the leaders of the Arabs found it difficult if they were not consulted in matters, so Allah commanded His Messenger (peace and blessings be upon him) to consult his companions so that his acting on his own opinion without them would not weigh heavily upon them.
It is also recited: "And consult them in some of the matter."
"Then when you have resolved..."
Meaning: when you have firmly decided upon something after consultation.
"...rely upon Allah."
In executing your decision toward what is most correct and beneficial, for what is most beneficial for you is known only to Allah, not to you nor to those you consult.
It is also recited: "Fa-idha 'azamta" (with a damma on the ta), meaning: "When I have resolved for you upon something and guided you to it, then rely upon Me and do not consult anyone after that."