How does ArcMap know the new command exists?
ArcMap knows what commands are available via component categories. A component category is an operating system registry key that contains component class IDs. Every component within ArcGIS, including components you create, has a globally unique identifier, also called a GUID. Once a component is registered with the operating system, it can be registered to a particular component category. ArcMap and the other desktop applications look for these component categories to work out which commands, tools, edit tasks, and so forth, are available. ArcGIS Desktop applications include the component category manager to help you manage this task. This step can also be automated with setup programs and developer add-ins.