Planets and their moons as spherical bodies. But smaller celestial bodies like asteroids and comets are often irregular in shape and have a tendency to seem more like potatoes. Why is that?

The form of a body is decided by the interaction between its gravity and solidity. Small asteroids and comets have little gravity, which is insufficient to force their larger rocks into a spherical distribution. But the gravity of the significantly larger moons and planets is so strong, in contrast, that it turns these celestial bodies into spheres. There are, of course, still uneven features on the surface of planets, like mountains and valleys, but they become smaller as gravity increases.

Rotation – that's, the spin their own axis – also plays a very important role with respect to the form of celestial bodies. The asteroid Cleopatra, for instance, describes a full rotation in as little as 5.3 hours and so has the elongated sort of a dumbbell: it's 135 miles long with a diameter of only about 56 miles. the big planets, too, are deformed through their rotation. The faster a planet rotates, the broader it becomes at the equator and also the flatter at the poles. Our Earth isn't an ideal sphere either. Its diameter over the poles is 26.5 miles smaller than at the equator.

Read more:

Vivekanand Vellanki
Good explanation