Mastodon is another federated protocol, totally separate from and different to Matrix.
Mastodon is more like a pub sub feed of things happening for a social network. Matrix is the p2p e2e communication layer for the internet at least if you believe them.
In general, it is interesting to think about the fragmentation of social spaces online over the last decade or so. It only seems to be picking up. There’s always irc for the hardcore people, there’s things like ssb if you’re hardcore + a kiwi, matrix, mastodon (though they serve different purposes), then all the usual centralized stuff… Lots to take in and reflect on, which is one of the reasons that I’ve always liked Matthew’s approach of “communication layer” and the attention they have paid to standards over the years (boring and protracted though that way may seem).