How did the planets and moons become spherical?

by handcuffed_
Polybios

This is outside the purview of history. /r/AskScience probably has an answer for you, so please try there!