This includes information that is submitted voluntarily or extracted via a discovery request. (Not everything you find is public only what you submit as evidence)
Note you can avoid things becoming public but you need a decent reason to "I don't want to share that" isn't enough. It looks like this document was partially redacted for instance.
To your original question courts make the proceedings "public" although there is a process for getting a copy. Not so much a "can you get this" more of a "we don't upload to a server and let web crawlers index everything".
Like if all messages were auto-deleted after 30 days or something.
IMO rules like this are why American corporations are investable. Rule of law is and must be respected.
SOX compliance requires 7 years.
https://www.pymnts.com/news/regulation/2022/goldman-sachs-an...
That said, there are some categories of information that Microsoft would have to retain. In particular, once you reasonably anticipate imminent litigation you have a duty to retain related information.
For the CEOs, they were already under intense scrutiny for every single trade, so it makes more different.
It doesn't matter if they're end-to-end encrypted with something like Signal. Microsoft would still be required to hand over what the court requested.