Background and Lead-up
When Möngke Khan became Great Khan in 1251, he immediately set out to implement his grandfather Genghis Khan's plan for a world empire. To lead the task of subduing the nations in the West, he selected his brother, another of Genghis Khan's grandsons, Hulagu Khan.
Assembling the army took five years, and it was not until 1256 that Hulagu was prepared to begin the invasions. Operating from his base in Iran, Hulagu proceeded south. Möngke had ordered good treatment for those who yielded without resistance and destruction for the rest. In that way, Hulagu and his army had conquered some of the most powerful and longstanding dynasties of the time.
Other countries in the Mongols' path submitted to Mongol authority and contributed forces to the Mongol army. When the Mongols had reached Baghdad, their army included Cilician Armenians and even some Frankish forces from the submissive Principality of Antioch. The Assassins in Persia fell, the 500-year-old Abbasid Caliphate of Baghdad was destroyed, and the Ayyubid dynasty in Damascus fell as well. Hulagu's plan was then to proceed southwards through the Kingdom of Jerusalem towards the Mamluk Sultanate, to confront the other major Islamic power.
In 1260, Hulagu sent envoys to Qutuz in Cairo with a letter demanding his surrender. Qutuz responded, however, by killing the envoys and displaying their heads on Bab Zuweila, one of the gates of Cairo.
Shortly before the battle, Hulagu withdrew from the Levant with the bulk of his army, leaving his forces west of the Euphrates with only one tumen (nominally 10,000 men, but usually fewer), and a handful of vassal troops under the Naiman Nestorian Christian general Kitbuqa Noyan, commonly known as Kitbuqa.
Until the late 20th century, historians believed that Hulagu's sudden retreat had been caused by the power dynamic having been changed by the death of the Great Khan Möngke on an expedition to the Song dynasty's China, which made Hulagu and other senior Mongols return home to decide his successor. However, contemporary documentation discovered in the 1980s reveals that to be untrue, as Hulagu himself claimed that he withdrew most of his forces because he could not sustain such a large army logistically, that the fodder in the region had been mostly used up and that a Mongol custom was to withdraw to cooler lands for the summer.
Upon receiving news of Hulagu's departure, Mamluk Sultan Qutuz quickly assembled a large army at Cairo and invaded Palestine. In late August, Kitbuqa's forces proceeded south from their base at Baalbek, passing to the east of Lake Tiberias into Lower Galilee. Qutuz was then allied with a fellow Mamluk, Baibars, who chose to ally himself with Qutuz in the face of a greater enemy after the Mongols had captured Damascus and most of Bilad ash-Sham.
The Mongols attempted to form a Franco-Mongol alliance or at least to demand the submission of the remnant of the Crusader Kingdom of Jerusalem, now centered on Acre; but Pope Alexander IV had forbidden it. Tensions between the Franks and the Mongols had also increased when Julian of Sidon caused an incident which resulted in the death of one of Kitbuqa's grandsons. Angered, Kitbuqa sacked Sidon. The Barons of Acre and the remainder of the Crusader outposts, contacted by the Mongols, had also been approached by the Mamluks and sought military assistance against the Mongols.
Though the Mamluks were the traditional enemies of the Franks, the Barons of Acre recognised the Mongols as the more immediate menace and so the Crusaders opted for a position of cautious neutrality between the two forces. In an unusual move, they agreed that the Egyptian Mamluks could march north through the Crusader states unmolested and even camp to resupply near Acre. When news arrived that the Mongols had crossed the Jordan River, Sultan Qutuz and his forces proceeded southeast, toward the site known in Arabic as "the Spring of Goliath" (Ain Jalut), in the Jezreel Valley, today called the Spring of Harod in Hebrew.
The Battle
The first to advance were the Mongols, whose force also included troops from the Kingdom of Georgia and about 500 troops from the Armenian Kingdom of Cilicia, both of which had submitted to Mongol authority. The Mamluks had the advantage of knowing the terrain, and Qutuz capitalized on that by hiding the bulk of his force in the highlands and hoping to bait the Mongols with a smaller force, under Baibars.
Both armies fought for many hours, with Baibars usually implementing hit-and-run tactics to provoke the Mongol troops and to preserve the bulk of his troops intact. When the Mongols carried out another heavy assault, Baibars, who it is said had laid out the overall strategy of the battle since he had spent much time in that region earlier in his life as a fugitive, and his men feigned a final retreat to draw the Mongols into the highlands to be ambushed by the rest of the Mamluk forces concealed among the trees. The Mongol leader, Kitbuqa, already provoked by the constant fleeing of Baibars and his troops, committed a grave mistake. Instead of suspecting a trick, Kitbuqa decided to march forward with all of his troops on the trail of the fleeing Mamluks. When the Mongols reached the highlands, Mamluk forces emerged from hiding and began to fire arrows and attack with their cavalry. The Mongols then found themselves surrounded on all sides. Additionally, Timothy May hypothesizes that a key moment in the battle was the defection of the Mongol Syrian allies.
The Mongol army fought very fiercely and very aggressively to break out. Some distance away, Qutuz watched with his private legion. When Qutuz saw the left wing of the Mamluk army almost destroyed by the desperate Mongols seeking an escape route, he threw away his helmet, so that his warriors could recognize him. He was seen the next moment rushing fiercely towards the battlefield yelling wa islamah! ("Oh my Islam"), urging his army to keep firm and advancing towards the weakened side, followed by his own unit. The Mongols were pushed back and fled to a vicinity of Beisan, followed by Qutuz's forces, but they managed to reorganize and to return to the battlefield, making a successful counterattack. However, the battle shifted toward the Mamluks, who now had both the geographic and psychological advantage, and some of the Mongols were eventually forced to retreat. Kitbuqa, with almost the rest of the Mongol army that had remained in the region, perished.
Aftermath
Hulagu Khan ordered the execution of the last Ayyubid emir of Aleppo and Damascus, An-Nasir Yusuf, and his brother, who were in captivity, after he heard the news of the defeat of the Mongol army at Ain Jalut.[30] However, the Mamluks captured Damascus five days later after Ain Jalut, followed by Aleppo within a month.
On the way back to Cairo after the victory at Ain Jalut, Qutuz was assassinated by several emirs in a conspiracy led by Baibars. Baibars became the new Sultan. Local Ayyubid emirs sworn to the Mamluk sultanate subsequently defeated another Mongol force of 6,000 at Homs, which ended the first Mongol expedition into Syria. Baibars and his successors would go on to capture the last of the crusader states in the Holy Land by 1291.
Internecine conflict prevented Hulagu Khan from being able to bring his full power against the Mamluks to avenge the pivotal defeat at Ain Jalut. Berke Khan, the Khan of the Golden Horde to the north of Ilkhanate, had converted to Islam and watched with horror as his cousin destroyed the Abbasid Caliph, the spiritual and administrative center of Islam. The Muslim historian Rashid-al-Din Hamadani quoted Berke as sending the following message to Mongke Khan, protesting the attack on Baghdad since he did not know that Mongke had died in China: "He (Hulagu) has sacked all the cities of the Muslims, and has brought about the death of the Caliph. With the help of God I will call him to account for so much innocent blood." The Mamluks, learning through spies that Berke was a Muslim and was not fond of his cousin, were careful to nourish their ties to him and his Khanate.
Later on, Hulagu was able to send only a small army of two tumens in his sole attempt to attack the Mamluks in Aleppo in December 1260. They were able to massacre a large number of Muslims in retaliation for the death of Kitbuqa, but after a fortnight could make no other progress and had to retreat.
After the Mongol succession was finally settled, with Kublai as the last Great Khan, Hulagu returned to his lands by 1262 and massed his armies to attack the Mamluks and avenge Ain Jalut. However, Berke Khan initiated a series of raids in force that lured Hulagu north, away from the Levant, to meet him. Hulagu suffered a severe defeat in an attempted invasion north of the Caucasus in 1263. That was the first open war among the Mongols and signaled the end of the unified empire. Hulagu Khan died in 1265 and was succeeded by his son Abaqa.
The Muslim Mamluks have defeated the Mongols in all battles except one. Beside a victory to the Mamluks in Ain Jalut, the Mongols were defeated in the second Battle of Homs, Elbistan and Marj al-Saffar. After five battles with the Mamluks, the Mongols only won at the Battle of Wadi al-Khaznadar. They never returned to Syria again.
The most common argument I've heard in alternate history circles is that Europe had way more stone fortifications than anywhere else in the world and the Mongols wouldn't have the will to siege down tens of thousands of castles (supposedly).