An undertow is a type of ocean current that is caused by waves breaking on the shore. Most are quite mild and not dangerous, as long as swimmers keep their heads, although some have been known to be powerful enough to sweep swimmers out to sea. Incidentally, an undertow is not the same thing as a rip current, although the two currents are both caused by breaking waves on the shore.
To understand how an this current works, a person can think about what happens when waves break on shore. The water obviously has to go somewhere, and this is what causes an undertow: as waves break, water from previous waves runs underneath them, creating a gentle current that runs back out to sea. When there is heavy wave action, the water may not be able to get out and as a result, it builds up and seeks a weak point in the breaking waves. When the water finds a weak point, it pushes out to sea, creating a rip current.
The difference between these two types of currents is significant. Most undertows are not very strong, and the risk of one is most severe for inexperienced swimmers who are standing or swimming near breaking waves. An undertow can pull someone underwater for a few seconds, but if the swimmer remains calm and swims towards the surface, he or she should be OK. This current is not usually strong enough to prevent the swimmer from returning to shore, unlike a rip current, which could carry the swimmer out to sea.
When swimmers encounter strong undertows, the tempting thing to do is to push towards the shore in the hopes of breaking through the current. This is actually a terrible idea, as swimmers can tire themselves out before they reach the shoreline. The best thing to do is to swim parallel to the shore, testing for a weak point that will allow the swimmer to get back to shore; the same technique works for rip currents. If a swimmer tires, he or she should tread water and float in the hopes that a rescuer will arrive soon.
Whenever someone visits an area with unfamiliar waters, it is a good idea for them to ask about prevailing currents. Locals can alert swimmers about areas with especially strong undertows, or areas where rip currents often arise. As a general rule, the steeper the slope that the waves approach on, the stronger the resulting current; long shallow approaches create much less wave velocity.