Obviously all the operation details of how they found this guy are not disclosed, but there does appear to be undercover agents involved.
There have been cases in the past where the FBI undercover agent has been a little too instrumental in developing the plan for the alleged attack, but it doesn’t appear that is the case in this instance.
I would not be surprised if some sort of mass surveillance was instrumental in identifying / risk scoring this guy’s posting and flagging him for closer investigation.
Not at all a supporter of these programs in general, but I wanted to try to answer your question.
[1] - https://www.buzzfeednews.com/article/salvadorhernandez/calif...
There is a well known sentiment that the craziest guy you’ll find if you are looking for trouble is the FBI agent.
There are documented instances of FBI agents selling fake bombs or drugs to CIA or DEA guys or vice versa.
It’s works for them because they get to pay themselves on the back for stopping the guy they helped radicalize who never would have had means on his own.
[1]: https://www.nsa.gov/News-Features/News-Stories/Article-View/...
That's a pretty weak outcome for such egregious privacy violations.
If they'd "stopped 17 plots to kill 100 or more Americans" then maybe I'd concede that the program is effective (though still immoral IMO).