Your understanding is pretty correct. Mastodon has been around for several years, and it's one of these federated services that's
slowly been gaining popularity recently, but, yeah, Musk's Twitter takeover has certainly brought it back into the center spotlight.
E-mail is an good analogy, and one that I've seen used many times to describe Mastodon. Mastodon is decentralized. So, yes, anyone can run their own server, and messages can be sent and seen across servers, but also individual server operators can moderate what content shows up in their server's feed. If I started a custom Mastodon server on applenova.com, as the owner/admin, I could block truthsocial.com so that people browsing my server would never see content that originated from there. This allows an operator to curate their instance's community with varying control, and that's why Mastodon's signup page encourages you to browse for a community that feels somewhat like-minded.
I registered a name on one of the big servers yesterday just to see what it's like, and, well, it's pretty much Twitter just not on Twitter.com.
Spoiler (click to toggle):