The Fifth Crusade was called by Pope Innocent III during the Fourth Lateran Council of 1215, intending it to start in 1217. It lasted until 1221, but although it was carefully organized and well-staffed, its strategy was flawed.
To be fair, the strategy seemed like a good idea at the time: sail to Egypt and attack, conquering what they believed to be an easier Muslim-controlled target. The Crusaders could then use Egypt as a staging area to attack the Holy Land. To make a long story short, the first of the Crusading fleet reached the Nile harbor town of Damietta on 27 May, 1218, and waited a few days for others to catch up. (It was not unusual that storms separated the ships, and so they did not all arrive simultaneously.) The most dynamic defender of that part of the world, Saladin, had died in 1193; his brother al-Adil took up the role of defender. al-Adil preferred to manage non-Muslims with treaties rather than jihad, and was disappointed in the Crusaders' next action.
The Siege of Damietta began on 23 June, but the town of Damietta had strong stone walls and a large stone tower that secured a chain across the mouth of the harbor to defend against ships. The first assault failed when scaling ladders collapsed and the town defended itself with a barrage of stones. The next day, however, the main tower was breached, the chain was cut, and ships could enter the Nile. al-Adil's son, al-Kamil, scuttled several ships upriver from the mouth of the Nile, preventing the Crusader ships from sailing further.
The Crusaders then built a floating fortress to use on the river, but a storm on 9 November blew it toward the Egyptian camp, whereupon the Egyptians overtook it and slaughtered all but two Crusaders. The two survivors were executed by the Crusade leaders for cowardice, having managed to escape the assault.
At this point, al-Adil's sons, al-Kamil and al-Mu'azzam, made an offer: we will give up Jerusalem to you (with two small exceptions) if you evacuate Egypt. You would think this was a direct route to their goal, but something—or rather someone—stood in the way. I will address that next.