Sources in touch with the New York Times purport that Yahoo was one of the companies with enough brass to try to resist national security data requests before its indoctrination into PRISM. In a secretive court though, the company was given the choice to either cooperate with federal agencies or submit to breaking the law. Yahoo, along with several other companies, chose the former.
If you've managed to somehow miss it, PRISM is an NSA-led effort to indiscriminately vacuum up all electronic communications into a central, searchable database. From there, authorized agents are able to sift through enormous sets of data, using methods like software-based heuristics to gather information which the agency argues is vital to foiling future terrorist plots. Details of PRISM's existence were exposed by Edward Snowden, an ex-government contractor who is now on the run for publishing classified documents.
"The petitioner suggests that, by placing discretion entirely in the hands of the Executive Branch without prior judicial involvement, the procedures cede to that Branch overly broad power that invites abuse." the court continued. "But this is little more than a lament about the risk that government officials will not operate in good faith. That sort of risk exists even when a warrant is required."
FISC, the Foreign Intelligence and Surveillance Court is the product of FISA, the Foreign Intelligence Surveillance Act. The bill, amongst other things, grants feds the freedom to spy on foreigners and "their agents" without the need for a traditional warrant. Instead, the FISA court has its own process by which it issues warrants -- a process which is reportedly entirely non-transparent and less rigorous. Worst yet, the FISC has been accused of being a "rubber stamp" for federal authorities.