“Hamas traded a single Israeli soldier, Gilad Shalit, for more than 1,000 Palestinians, including Mr. Sinwar, a prison leader who had been involved in the negotiations”

Link. Hamas feared irrelevance; the dull burden of governance. They thought war might save them, and Israel had shown they would pay any price to free a hostage. Then they succeeded beyond their wildest expectations.