Ms. Ibrahim’s case has also raised legal questions about detaining people whose names appear on the no-fly list, and it casts light on the role of private contractors in deciding whether someone should be held. The police in San Francisco said they had acted on the instructions of a contractor working for the Homeland Security Department.

Image Erich Scherfen, a Persian Gulf war veteran and a pilot from Pennsylvania, was on a watch list. Credit... Niko J. Kallianiotis for The New York Times

The government is fighting back, and there is no guarantee that Ms. Ibrahim, a 44-year-old mother of four, will ever learn more about what happened. However, an examination of her case, along with documents from other lawsuits, government audits and official testimony, offers some broad hints about the murky system.

The watch list is actually a succession of lists, beginning with the Terrorist Identities Datamart Environment, or TIDE, a centralized database of potential suspects. Mr. Travers said that about 10,000 names come in daily through intelligence reports, but that a large percentage are dismissed because they are based on “some combination of circular reporting, poison pens, mistaken identities, lies and so forth.”

Analysts at the counterterrorism center then work with the Terrorist Screening Center of the F.B.I. to add names to what is called the consolidated watch list, which may have any number of consequences for those on it, like questioning by the police during a traffic stop or additional screening crossing the border. That list, in turn, has various subsets, including the no-fly list and the selectee list, which requires passengers to undergo extra screening.

The consolidated list has the names of more than 400,000 people, about 97 percent of them foreigners, while the no-fly and selectee lists have about 6,000 and 20,000, respectively.

The standards for adding names to the lists have gone through a cycle of tightening, then relaxing. After the Sept. 11 attacks, hundreds of names were added with few guidelines, eventually leading to complaints that too many innocent travelers were being stopped. Two years ago, the government developed a reasonable suspicion standard and secret protocols for applying it; their last major revision was outlined in a 72-page memorandum in February 2009 that clarified the “minimum substantive derogatory criteria.”

A federal official involved in the process said that under those rules, associating with a known or suspected terrorist was not enough to warrant being listed; there had to be evidence that the person supported terrorism. The criteria also generally require more than a single source of “derogatory information,” said the official, who requested anonymity to discuss security matters.