Sideways currents are created when the surf increases in size. In large surf the waves do not approach the beach straight on, but at an angle. It is this angle that causes the lateral current and will soon become stronger due to the parallel direction of the surf. Swimmers can bounce along in a lateral current, be pulled outside of the Lifeguard flags, and soon be in the middle of a rip current.
It is important to remember when escaping a Rip Current to swim with the lateral/long-shore current, not against it. Otherwise the lateral current will pull you back into the Rip Current.