cPanel and other control panels aren't very simple to explain in a single StackOverflow question in my opinion.
Trying to put it simpler, it consists in a process of:
- creating a user on the operating system;
- creating the skeleton folders;
- assigning the right permissions;
- assigning the right account limits;
- creating a virtual host in apache;
- configuring internal dns entries;
- creating a user in its database so they can login later;
- send confirmation emails about account creation;
These are some basic steps required to make a system like cPanel add a new account. There are probably many more that I'm not thinking of.