I'll bet it was by using the provisions contained in The Patriot Act.
No. Wait. That can't be. They don't actually use The Patriot Act to surveill people, they just use it to collect metadata.
So, how DID they come by this plot? And why don't they do more of that?
Undercover? Someone ratted? Some aspiring terrorist too big for his ego left obvious clues in messages?
Oddly enough, Patriot Act provisions are only rarely used against terrorists and potential terrorists. However, there are a huge number of other surveillance systems independent of the Patriot Act, such as:
NarusInsight, the replacement for CARNIVORE (later renamed DCS1000), created by a subsidiary of Boeing, which is how the FBI directly monitors email and electronic communications. CARNIVORE was implemented in October 1997.
CALEA, the Communications Assistance for Law Enforcement Act (1994), which creates back doors in communications and Internet companies, allowing federal agencies to monitor all telephone, broadband internet, and VoIP traffic in real-time.
If the FBI and others don’t want to request companies first, they use DCSNet and the related Red Hook system, which do so surreptitiously.
These were all highly efficient systems, as well as many others not mentioned, and worked quite well against terrorists and terrorism. What the Patriot act did was increase the amount of surveillance a hundred fold, but the vast majority of that surveillance is not directed at known or suspected terrorists, but at everyone else.
“We spy on everybody because we can. Screw ethics.”