A Combat Air Patrol, or "CAP", is a part of a ship's early warning network and defensive posture in protecting the ship and it's accompanying vessels, if any, during wartime.
CAPs typically consist of two Vipers flying a designated pattern in and around the ship(s) in order to provide an immediate space-borne response to incoming threats. CAP flights are sometimes be accompanied by a Raptor, particularly if trouble is anticipated and are usually led by a Squadron Leader.
It is possible that more than one CAP may be flown at a time, with Vipers positioned at different distances from the ship, and occupying different "orbits" around the fleet. In this case, usually only one or two squadron leaders are flying CAP.
CAP flights are backed-up by the alert fighters.