How is gravity involved in the formation of stars?