When we look at the Qur'an, we see that all of the Messengers and their faithful followers share a common destiny. The community of believers led by a Messenger always begins its struggle as a small group. This community of believers proclaims Allah's religion and struggles with enemies who appear to be much stronger. However, the Messengers and the believers always emerge victorious, for: "...How many a small force has triumphed over a much greater one by Allah's permission? Allah is with the steadfast" (Surat al-Baqara, 249).
All of these struggles are conducted according to Allah's will, for He created both the believers and their enemies. It is revealed in the Qur'an that Allah made special enemies for Messengers to struggle against:
In this way, We have appointed as enemies to every Prophet, satans from both humanity and the jinn, who inspire each other with delusions by means of specious words – if your Lord had willed, they would not have done it. So abandon them and all they fabricate. (Surat al-An'am, 112)
In this way, We have assigned to every Prophet an enemy from among the evildoers. But your Lord is a sufficient guide and helper. (Surat al-Furqan, 31)
Allah has created both sides of this struggle and determines the outcome. He has written victory in the destiny of the Messengers. As revealed in the Qur'an, there can be no question of a Messenger ever being defeated:
Allah has written: "I will be victorious, I and My messengers." Allah is Most Strong, Almighty. (Surat al-Mujadala, 21)
One of the reasons why a community of believers experiences apparent defeats is because they do not obey the Messenger. In Surah Al 'Imran Allah states that some believers did not obey our Prophet's (saas) commands during the Battle of Uhud, and therefore they lost that battle, even though they were apparently going to win. But this temporary defeat was useful for believers as part of a training process created to teach them how to obey. Finally, the Prophet (saas) and his faithful followers were victorious. And those who are hostile to a Messenger always come to the same end: humiliation in this world and the pangs of hell in the hereafter:
Those who oppose Allah and His messenger will be subdued and overcome, just as those before them were also subdued and overcome. We have sent down clear signs. The unbelievers will have a humiliating punishment. On the Day Allah raises up all of them together, He will inform them of what they did. Allah has recorded it, while they have forgotten it. Allah is a Witness of all things. (Surat al-Mujadala, 5-6)
On the other hand, those who submit themselves to a Messenger are rewarded with victory in this world, paradise in the hereafter, and, above all, His good pleasure. In the Qur'an, Messengers and their faithful followers are called "the party of Allah," and their reward in the hereafter is described in these words:
You will not find people who believe in Allah and the Last Day having love for anyone who opposes Allah and His messenger, although they be their fathers, their sons, their brothers, or their clan. Allah has inscribed faith upon such people's hearts and will reinforce them with a Spirit from Him and admit them into Gardens with rivers flowing under them, remaining in them timelessly, forever. Allah is pleased with them, and they are pleased with Him. Such people are the party of Allah. Truly, it is the party of Allah who is successful. (Surat al-Mujadala, 22)
In other verses it is revealed that the Messengers and their followers will certainly be victorious:
Our Word was given before to Our servants, the messengers, that they would certainly be helped. It is Our army that will be victorious. (Surat as-Saffat, 171-173)
With Allah's permission, the "party of Allah" will prevail. His word is true and will most certainly be fulfilled.