Planets are spherical (roughly) in shape because a spherical configuration gives the minimum gravitational potential energy.
How does one prove that the sphere is the shape that gives minimum gravitational potential energy for a volume of uniformly dense material?