Prisoner Swap

U.S. Army Sgt. Bowe Bergdahl was freed over the weekend after being held for 5 years as a prisoner of war by the Taliban. In return, the U.S. released five high-level Taliban officials from Guantanamo. What do we know about the negotiations behind the swap? How was Sgt. Bergdahl captured by the Taliban in the first place?