Matrix is an open source protocol for federated chatrooms, kind of like if someone mixed Lemmy with Discord and Signal. You make an account with a Matrix 'homeserver' (can be your own self-hosted server) just like Lemmy, so you'll have a username like [email protected]. Once you do you can join any number of Spaces, akin to Discord servers. Unlike Discord, these servers will be hosted on the homeserver which means they can be self-hosted, and often come with strong safety guarantees like end-to-end encryption or the double ratchet algorithm as seen in Signal (depending on how the homeserver is configured). Matrix is really just a protocol, so there are a bunch of chat clients that implement it, the first-party client is called Element, but there are many to choose from.
I would argue the main reason to use Matrix over Slack or Discord is much the same reason you'd use Signal over Whatsapp - data privacy. Because you can self-host the homeserver any spaces you make can be hosted on your local machine. For those who are privacy advocates that's a very good reason to use Matrix over most other solutions. If you're a company or a concerned individual that routinely deals with data that really shouldn't be on the 'cloud' (e.g. trade secrets, materials under NDA, personal information, etc.) then Matrix seems like a better fit than say Slack, provided you self-host. Discord has been under fire for their privacy policy for end users, so you might consider Matrix as a replacement for Discord too.