How deals like the U.S.-Iran prisoner exchange come together