Building in public is very much an experimental form of communication. It's a new way to think and operate and it's not something with a strong set of conventions and norms. That means that you have to think much more about how you're communicating, not just what you want to say.
Building in community means sharing information with a specific set of people who have a shared perspective. Conventions and norms do exist and you have a good sense of how people will interpret and understand your words. This is the kind of context where it is easier to be more authentic and less performative.
I think that a good chunk of people who build in public whould say that they are actually building in community. They get the sense of a shared perspective and the community has established some its own conventions and norms. I don't think there's always a clear seperation between these two concepts.
As an interesting example of how these two concepts overlap is in the Zig community[0]. The community is decentralized - does that mean they are building in community AND in public?