The presence of liquid water on the surface is one of Earth’s defining characteristics, and it is usually considered to be critical for planetary habitability. Moreover, Earth not only has surface water but also has just the right amount of it to allow the subaerial exposure of continental crust, which is important for various geochemical and biogeochemical cycles. Unlike its sister planet Venus, Earth also has a right amount of carbon dioxide in the atmosphere to maintain moderate surface environments. When considering the making of a habitable planet, therefore, understanding the volatile budget and its spatial distribution within a planet is particularly important. I will discuss two recent developments on this issue, (1) how early mantle evolution could dictate the long-term evolution of surface environments, and (2) how high-energy planetary accretion processes could shape the volatile budget.