it was his cia kill switch going off accidentally. in the early days of the 1960's the cia was so paranoid of losing people to the soviets as defectors or prisoners they clandestinely installed tiny remote explosive devices in hundreds of high ranking officials without their notice. jfk's was among the earliest installed during one of his "back surgeries". these early models weren't detonated by a manual remote, but set to go off at sudden harsh alterations of blood pressure, with the idea being that if someone was kidnapped, and subject to torture they would go off. kennedy's activated after he was shot.
Canada