Technically, a server is a computer dedicated to handling internet traffic. Discord misuses the word to refer to a closed community. I suppose it could apply to something similar on Mastodon, but they use the word “instance” for some reason. It’s just a different word for the same thing.
Twitter has a bunch of servers. That is, computers that take in tweets people post and then send them out to the users. But there’s only one Twitter. Public tweets are visible to anyone, and if you search a hashtag or something, you’ll find all the relevant tweets in one place. There’s no other Twitter you can post to.
Discord has a bunch of servers in both senses of the word. They have physical computers tasked to take in messages and send them out. But they’ve also got closed communities of varying sizes with varying purposes. Every Discord server uses the Discord platform, but if you’re not in a given server community, you can’t see anything in it. Even if you are in more than one server, messages in one server stay in that server and aren’t visible anywhere else.
Mastodon is different. It’s a blend of the two. Each instance is independent of the others. As Clang said, it’s like an archipelago. Each instance is an island. A closed community with its own policies and moderators and so on. Each is independently owned and operated, and is hosted on totally separate computers. The federation is, in this analogy, the ocean. It’s a broader system that surrounds and links the disparate islands, allowing some messages to be carried between them. (And even further, to some other platforms like Diaspora, which can talk to Mastodon servers even though they’re not using exactly the same software.)
What that means is that if you join mastodon.social you’ll mainly be interacting with people who are also on that instance. You’ll be subject to the policies of that instance, which are enforced by the moderators of that instance. But it’s set up so that you can still interact with people in other instances. You can follow their posts, have them follow you, tag them, send them private messages, etc. You can also basically retweet people (although that’s not the name for it on Mastodon), although unlike Twitter there’s no quote tweet function to allow you to add your own take on things. However, all of that can be limited. You can make posts that are only visible within the instance you’re on. And the people who own that instance can block or filter posts from other instances they don’t like.
For example, the owners of one instance may be opposed to transgender rights while the owners of another instance may be staunchly in favor. One or both of those may block the other so that they don’t have to deal with unwelcome messages. Or one instance may allow people to post NSFW images while another has rules against it. The latter instance may add a filter rule so that people from the NSFW server can still talk to each other with text, but images from the NSFW community are not visible to people within the SFW community.
Does that make sense?