Siege
Food and water reserves were taxed by the sudden influx of refugees. Soon, what was once a formidable undertaking became easy. The Mongols were then free to lay siege without interference of the field army, as it had been destroyed. At the siege of Aleppo, Hulagu used twenty catapults against the Bab al-Iraq (Gate of Iraq) alone. 
In Jûzjânî, there are several episodes in which the Mongols constructed hundreds of siege machines in order to surpass the number which the defending city possessed. While Jûzjânî surely exaggerated, the improbably high numbers which he used for both the Mongols and the defenders do give one a sense of the large numbers of machines used at a single siege.
Another Mongol tactic was to use catapults to launch corpses of plague victims into besieged cities. The disease-carrying fleas from the bodies would then infest the city, and the plague would spread, allowing the city to be easily captured, although this transmission mechanism was not known at the time. In 1346, the bodies of Mongol warriors of the Golden Horde who had died of plague were thrown over the walls of the Crimean city of Kaffa (now Feodosiya) during the Siege of Caffa. It has been speculated that this operation may have been responsible for the advent of the Black Death in Europe. The Black Death is estimated to have killed 30%–60% of Europe's population.
On the first night while laying siege to a city, the leader of the Mongol forces would lead from a white tent: if the city surrendered, all would be spared. On the second day, he would use a red tent: if the city surrendered, the men would all be killed, but the rest would be spared. On the third day, he would use a black tent: no quarter would be given.

However, the Chinese were not completely defenseless, and from AD 1234 until 1279, the Southern Song Chinese held out against the enormous barrage of Mongol attacks. Much of this success in defense lay in the world's first use of gunpowder (i.e. with early flamethrowers, grenades, firearms, cannons, and land mines) to fight back against the Khitans, the Tanguts, the Jurchens, and then the Mongols.
The Chinese of the Song period also discovered the explosive potential of packing hollowed cannonball shells with gunpowder. Written later c. 1350 in the Huo Long Jing, this manuscript of Jiao Yu recorded an earlier Song-era cast-iron cannon known as the 'flying-cloud thunderclap eruptor' (fei yun pi-li pao). The manuscript stated that (Wade–Giles spelling):

The shells (phao) are made of cast iron, as large as a bowl and shaped like a ball. Inside they contain half a pound of 'magic' gunpowder (shen huo). They are sent flying towards the enemy camp from an eruptor (mu phao); and when they get there a sound like a thunder-clap is heard, and flashes of light appear. If ten of these shells are fired successfully into the enemy camp, the whole place will be set ablaze...

During the Ming dynasty (AD 1368–1644), the Chinese were very concerned with city planning in regards to gunpowder warfare. The site for constructing the walls and the thickness of the walls in Beijing's Forbidden City were favoured by the Chinese Yongle Emperor (r. 1402–1424) because they were in pristine position to resist cannon volley and were built thick enough to withstand attacks from cannon fire.
For more, see Technology of the Song dynasty.

Age of gunpowder: The introduction of gunpowder and the use of cannons brought about a new age in siege warfare. Cannons were first used in Song dynasty China during the early 13th century, but did not become significant weapons for another 150 years or so. In early decades, cannons could do little against strong castles and fortresses, providing little more than smoke and fire. By the 16th century, however, they were an essential and regularized part of any campaigning army, or castle's defences.
The greatest advantage of cannons over other siege weapons was the ability to fire a heavier projectile, farther, faster, and more often than previous weapons. They could also fire projectiles in a straight line, so that they could destroy the bases of high walls. Thus, 'old fashioned' walls – that is, high and, relatively, thin – were excellent targets, and, over time, easily demolished. In 1453, the Theodosian Walls of Constantinople, the capital of the Roman Empire, were broken through in just six weeks by the 62 cannons of Mehmed II's army, although in the end the conquest was a long and extremely difficult siege with heavy Ottoman casualties due to the repeated attempts at taking the city by assault.

However, new fortifications, designed to withstand gunpowder weapons, were soon constructed throughout Europe. During the Renaissance and the early modern period, siege warfare continued to dominate the conduct of the European wars.
Once siege guns were developed, the techniques for assaulting a town or fortress became well known and ritualized. The attacking army would surround a town. Then the town would be asked to surrender. If they did not comply, the besieging army would surround the town with temporary fortifications to stop sallies from the stronghold or relief getting in. The attackers would next build a length of trenches parallel to the defenses (these are known as the "first parallel") and just out of range of the defending artillery. They would dig a trench (known as a forward) towards the town in a zigzag pattern so that it could not be enfiladed by defending fire. Once they were within artillery range, they would dig another parallel (the Second Parallel) trench and fortify it with gun emplacements. This technique is commonly called entrenchment.
If necessary, using the first artillery fire for cover, the forces conducting the siege would repeat the process until they placed their guns close enough to be laid (aimed) accurately to make a breach in the fortifications. In order to allow the forlorn hope and support troops to get close enough to exploit the breach, more zigzag trenches could be dug even closer to the walls, with more parallel trenches to protect and conceal the attacking troops. After each step in the process, the besiegers would ask the besieged to surrender. If the forlorn hope stormed the breach successfully, the defenders could expect no mercy.

Emerging theories: The castles that in earlier years had been formidable obstacles were easily breached by the new weapons. For example, in Spain, the newly equipped army of Ferdinand and Isabella was able to conquer Moorish strongholds in Granada in 1482–1492 that had held out for centuries before the invention of cannons.
In the early 15th century, Italian architect Leon Battista Alberti wrote a treatise entitled De Re aedificatoria, which theorized methods of building fortifications capable of withstanding the new guns. He proposed that walls be "built in uneven lines, like the teeth of a saw". He proposed star-shaped fortresses with low, thick walls.
However, few rulers paid any attention to his theories. A few towns in Italy began building in the new style late in the 1480s, but it was only with the French invasion of the Italian peninsula in 1494–1495 that the new fortifications were built on a large scale. Charles VIII invaded Italy with an army of 18,000 men and a horse-drawn siege-train. As a result, he could defeat virtually any city or state, no matter how well defended. In a panic, military strategy was completely rethought throughout the Italian states of the time, with a strong emphasis on the new fortifications that could withstand a modern siege.

New fortresses: The most effective way to protect walls against cannon fire proved to be depth (increasing the width of the defenses) and angles (ensuring that attackers could only fire on walls at an oblique angle, not square on). Initially, walls were lowered and backed, in front and behind, with earth. Towers were reformed into triangular bastions. This design matured into the trace italienne. Star-shaped fortresses surrounding towns and even cities with outlying defenses proved very difficult to capture, even for a well-equipped army. Fortresses built in this style throughout the 16th century did not become fully obsolete until the 19th century, and were still in use throughout World War I (though modified for 20th-century warfare). During World War II, trace italienne fortresses could still present a formidable challenge, for example, in the last days of World War II, during the Battle in Berlin, that saw some of the heaviest urban fighting of the war, the Soviets did not attempt to storm the Spandau Citadel (built between 1559 and 1594), but chose to invest it and negotiate its surrender.
However, the cost of building such vast modern fortifications was incredibly high, and was often too much for individual cities to undertake. Many were bankrupted in the process of building them; others, such as Siena, spent so much money on fortifications that they were unable to maintain their armies properly, and so lost their wars anyway.