The universal law of gravitation explains the attraction between planet and a star. The gravitational pull of the sun on the planet keeps then revolving around the Sun.
The tides formed by the rising and falling of water level in the oceans are due to the gravitation force of sun and moon on the water.