The legal definition of a weapons "pat down" search traces back to the 1968 U.S. Supreme Court decision in Terry v. Ohio. In that case, the court considered two different kinds of Fourth Amendment actions—a "stop" (a temporary detention of a pedestrian or driver, which is a seizure of the person), and a "frisk" (a limited search of the stopped person's outer clothing to check for weapons). The court set standards for justifying each: the stop is justifiable if there is a reasonable suspicion the person is involved in criminal activity; the frisk is justifiable if there is a reasonable suspicion the detainee may be armed and dangerous.
Although it's common to see the term "stop and frisk" to describe this pairing, it's important to realize that this phrase describes both a seizure and a search, each of which requires specific justification. It's possible that there might be justification for a stop, but not for a frisk.
For example, if you stop someone based on reasonable suspicion that he was recently involved in an act of indecent exposure, the stop would be valid, but no frisk could be lawfully performed in the absence of reasons to believe the suspect was armed and dangerous. In other words, it's not the rule that you can automatically frisk everyone you lawfully stop.
Arizona v. Johnson
Lemon Johnson was a passenger in a car stopped in Tucson for vehicle registration violations. The stop occurred in a neighborhood associated with the Crips gang. Johnson was wearing Crips colors, including a blue bandana. He had a scanner in his jacket pocket, which suggested to the officers that he was monitoring police radio traffic. This was an indication that the occupants of the car might be engaged in some kind of illegal activity. Johnson's given address was in a Crips area, and he disclosed that he had been to prison for burglary. An officer then asked him to step out of the car.
Based on the observed facts and the inferences the officer drew from them, she suspected that Johnson might be armed and dangerous. A frisk of his outer clothing revealed a handgun, which Johnson was not legally entitled to possess. He was arrested, charged, and convicted, but the Arizona Court of Appeals reversed. That court held that because there was no reasonable suspicion to believe Johnson was engaged in any criminal activity as a passenger in a stopped car, police had no right to frisk him—even if they had a reasonable suspicion he might be armed. The Arizona Supreme Court declined to review the case, and the State appealed to the U.S. Supreme Court.
The U.S. Supreme Court unanimously reversed the Arizona suppression ruling. The court pointed out that under its decision in Brendlin v. California, all passengers in a stopped vehicle are necessarily detained during the traffic stop. If there is then articulable suspicion to believe that a particular passenger may be armed and dangerous, a pat search is justifiable.
Said the court, "A lawful roadside stop begins when a vehicle is pulled over for investigation of a traffic violation. The temporary seizure of driver and passengers ordinarily continues, and remains reasonable, for the duration of the stop. Normally, the stop ends when the police have no further need to control the scene, and inform the driver and passengers they are free to leave. An officer's inquiries into matters unrelated to the justification for the stop, this Court has made plain, do not convert the encounter into something more than a lawful seizure, so long as those inquiries do not measurably extend the duration of the stop.