In short – the Moon!
Tides are the rising of Earth’s ocean surface caused by the tidal forces of the Moon and the Sun acting on the oceans. Tides cause changes in the depth of the marine and estuarine water bodies and produce oscillating currents known as tidal streams, making prediction of tides important for coastal navigation . The strip of seashore that is submerged at high tide and exposed at low tide, the intertidal zone, is an important ecological product of ocean tides.
The changing tide produced at a given location is the result of the changing positions of the Moon and Sun relative to the Earth coupled with the effects of Earth rotation and the bathymetry of oceans, seas and estuaries. Besides the ocean, tidal phenomena can occur in other systems whenever a gravitational field that varies in time and space is present.
The daily sea-level fluctuations, as they actually occur — especially in shallow seas and near coasts — are not solely caused by the astronomical tidal forcing, but may also be strongly affected by meteorology (wind and barometric pressure), for instance resulting in storm surges
There are some good animations that explain how the tides work. This one is the simple version while this link will take you to all the variations for those who would like the current theories on the various tidal discrepancies in the world.