Lets talk about pre shadcn era -

And this is a registry, there is no centralized warehouse where your component codebase is stored, it works in a different way. The registry lies in every codebase which wants to share their component to everyone. Lets understand it in detail below. https://ui.shadcn.com/docs/registry

I will explain this with the flow from how the component is registered to installing and using it.
registry.json file in the root folder of your code base
registry.json is the entry point for the registry. It contains the registry's name, homepage, and defines all the items present in the registry.public/r/button.json.