The reason for this charade is because everytime somebody tries to sue the NSA over illegal data collection, the case gets tossed for lack of standing. You need to prove both that you were illegally spied on and negatively affected by such. If you can't prove that, then you have no standing to sue. And anytime people try to gather evidence of said collection in e.g. discovery, the government simply claims national security - and the case ends up tossed.
The public cases are efforts to try to streamline the process where the government could legally directly utilize such things. So you have this sort of charade where Apple is giving the government everything it wants in private, but then genuinely fighting them publicly. Both sides get more or less what they want out of the deal. Apple gets to pretend to be a protector of privacy, and the government gets unfettered access to whatever they want.
The Intercept has run a bunch of articles on this topic, alongside direct evidence of such. Here's one. [2]
[1] - https://en.wikipedia.org/wiki/Parallel_construction
[2] - https://theintercept.com/2017/11/30/nsa-surveillance-fisa-se...