For open source messengers, you can check whether they actually encrypt your messages and whether the server has access to your encryption keys but what about WhatsApp? Since it’s not open source, you can’t be sure that the encryption keys aren’t sent to the server, right? Has there been a case where a government was able to access WhatsApp chats without reading them from the phone itself?
They don’t have to attack the encryption, there are far easier ways. Compromising your phone then reading the notification contents for example. If a smallish company can do this (pegasus) imagine what the resources of the US intelligence complex can do.
The easiest way by far is to intimidate you to give up your phone password and hand over the messages.
XKCD for refference: https://xkcd.com/538/
Shouldn’t the phone disk be encrypted too?
Doesn’t matter if the phone is compromised while turned on.