NASA’s Hubble telescope captured an “extraordinarily” rare moment of a comet exploding into fragments, the space agency said.