It would be a frontend thing. Track separate communities behind the scenes but show them together in the frontend if the community settings tell you to.
!technology@all
I guess the problem here is there is no central server. Different instances know about different communities. You could have an instance side setting to show all communities with the same name together. However, this messes up location based communities (!politics!politics@lemmy.nz is for New Zealand politics, and merging with !politics@lemmy.world would be a bad idea). It would also mean the control is taken away from thw community itself. Doing it in that way would make moderation complicated.
I think having the ability for a community to opt to join with others is a better idea, though I admit I don't know all the implementation details.