Mastodon provides you with a 'federated timeline'. Basically your feed is a list of all posts the instance your account is on knows about, based on what the instance owners have configured. So you see all the posts directly from users in your instance, made on your instance, and also posts from other users in your subset of the fediverse, determined by what other instances your instance peers with. You can interact with users from other instances by referencing their handle and instance. So instead of @bob it would be more like @bob@xyz where xyz is the instance. You can follow a user from a different instance. Oddly, even though you can filter your federated timeline to your local instance, you cannot filter it to any other specific instance - for that you would need to create an account on that instance and view its local timeline. So basically it gives you a broader audience and user community than just your specific instance.
Some useful links that explain it further:
https://www.theverge.com/2017/4/7/15183128/mastodon-open-sou...
https://kevq.uk/how-does-mastodon-work/
https://docs.joinmastodon.org/user/network/