Here’s what led to the swap, which included 24 prisoners from seven countries, including Paul Whelan and Evan Gershkovich.