The tidal force is a primary energy source and can be considered an primary energy flow. In fact, animals on Earth have been taking advantage of tides for as long as they have existed. Humans have used the kinetic and potential energy of tides to do work for them, from using the tidal movements for mill operations, to reducing the manpower needed sail in and out of bays and estuaries. However, electrical generation from tides is relatively new.
Tidal forces are changes in the gravitational potential energy of the Sun, Moon and Earth. These forces cause the periodic motion of the seas which create a temporary change in water levels that vary depending on location. Due to the inverse square law, the side of Earth closest to the Sun or moon will experience a greater force than parts further away. This temporary change in gravitational force is what causes the variations in sea levels.
Interestingly enough, the Sun exerts a much stronger gravitational force on the Earth (about 175 times stronger when compared to the Moon) but has a smaller effect on the tides. The reason for this is because of the inverse square law—the Earth's diameter is a tiny fraction of the total distance between the Sun and Earth which means that the difference in gravitational force across the Earth varies by a very small amount. On the other hand, the Moon is much closer than the Sun, thus the difference in gravitational force from the Moon across the Earth is much greater. In fact, the Sun has approximately only 44% of tidal influence than that of the Moon.