Gravity and Planetary Formation