A study details how Earth became a ball frozen by coal