The height of tides is determined by a complex combination of factors relating to the positions of the Earth, sun and moon. Because the moon revolves around the Earth, the Earth revolves around the sun and the Earth also rotates on its own axis, the distances between the three bodies and their relative positions to one another constantly change. Depending on this distance and position, tides may be higher or lower, and tidal currents may be stronger or weaker.
For example, when the moon and sun align with the Earth, tides are stronger because the attraction of the moon and the sun combine. When they form a right angle with the Earth, their pulls partially cancel each other out, so the tides are weaker. The moon's gravitational attraction has more effect on tides than the sun's because it is 390 times closer to the Earth. Thus, its pull is twice as strong as the sun's [source: NOAA: Tides and Water Levels].
Although tidal characteristics are largely determined by these regularly occurring and predictable astronomical forces, constructing tide tables isn't an exact science. Among other things, factors such as existing ocean currents, winds, the contour of the ocean bottom and existing land masses must be accounted for. Existing ocean currents and winds, depending on their direction, can either negate or accentuate a tide's pull; while topography -- both above and below the ocean surface -- can slow tides down, speed them up and even raise or lower their height.
The most accurate tidal predictions usually exist for places located on the coast because they are less affected by winds and other meteorological events. Areas with shallow water or in a bay are more affected by alternate factors. For example, an estuary fed by a river might see tidal levels several feet higher than predicted if heavy rains flush in river water. An inland harbor that receives strong winds might have lower-than-predicted tides if the winds blow against the incoming tide.