How do I properly procedurally add components in C++?

Why do you need “registerComponent”?. I did it without it, and the component appeared anyway.