They can contribute to the same communities, but communities live on specific instances.
The main difference between instances is the moderation policy and who runs it really, but nobody is generally missing out anything depending on the instance they choose.
There is one exception to the above, which is when instances defederate each other. Imagine that instance A is full of content that is not accepted on B and C, B and C can defederate A to stop "talking to it". Currently beehaw has defederated Lemmy.world because of the amount of users and moderation capabilities, for example.
What federation does for you is that you, on lemmy.world, can access them both with a single login. (email: you can write a mail to mazkarth@hotmail.com from within your gmail webmail)