Astronomers have witnessed a rare and violent cosmic crash between two planets, and they say the fallout could teach us about the formation of our world.