Enormous ‘rogue waves’ can appear out of nowhere. Math is revealing their secrets.