Know how emails are standardised? Matrix is something similar, but for chats. Matrix (open sourced btw) is a protocol layer (similar to how smtp/pop3 are for mails), synapse is the server (the mail equivalent for sendmail/postfix) and then we have clients, or in simpler terms the UserInterface (mail equivalent of thunderbird/gmail/outlook).
Everyone can host its own servers and have it on private chat cloud similar to email and other opensource chat servers. But like for E-Mail, it is easy possible to federate with others (like mail 'gmail' to other mailservers), to be able to chat with people on other Matrix Servers. That's the difference to most of the other opensource chat.servers, which are stuck to their cloud.
Another cool feature is bridging. The protocol specification allows bridges to other chat-systems, so you are for example able to talk to IRC-Servers or XMPP-Servers too. Many bridges are in development, less are stable. But more to come in future.
TLDR: gmail mail id can send and receive mails from yahoo right? similarly matrix can (potentially) allow your instagram messages to be sent and received on whatsapp