Isaac II Angelos was the ruler of the Byzantine Empire in the early 1180s. Apparently, he wasn't a very well liked emperor. Once, while on a hunting trip, his older brother, Alexios III Angelos, declared himself emperor and the declaration was accepted very quickly by the Byzantine army. Upon his return, Isaac was imprisoned.
Alexios IV Angelos, son of Isaac II, wanted to re-take his father's place as Emperor, and he offered to supply the Crusaders with supplies, manpower, and ships. He also promised to place the Eastern Orthodox church under the authority of the Pope.
"Luckily" for Angelo IV, he was at court when Boniface of Montferrat (the leader of the 4th Crusade) decided to take a brief leave of absence from his crusading forces to visit his cousin Phillip, who was ruling in Germany at the time.
That's where the bargain was struck. Boniface decided to forgo his plan of invading the Holy Land through Egypt and instead take his army from Venice to Constantinople.