Most communities I’ve worked with have had some sections of the communities available to the public (i.e., guest users aka anyone not logged in to the community), and some sections that are member-only or only visible to specific roles.
It can generate some buzz to have exclusive content, but it can also be a bit of a balancing act between exclusivity and demonstrating value and giving folks a taste of the community (and convincing them to hit that join/register button)…
There are a few out there that are totally private and make nothing public to guests (aka not logged in users at all) —