Nuts and Volts magazine had a series of articles answering this question a while ago.
If you’re looking for: CNC Controls: GE Fanuc CNC Controller, you can look into GE Fanuc CNC Controls Online Classes.
If you’re looking for: CNC Controls: Haas Controller, you can look into Haas CNC Controls Online Classes.
Controls are very complicated things, and are not something a single person can implement without a lot of effort. The control interprets the g-code either created by a CAM program or written by hand, and turns that into the appropriate commands to the servo drives or steppers.
There are PC based control systems that can be had for free or low cost, such as Mach3 and EMC. EMC is open source, and if you are interested in mucking around with the internals you may. If you are only looking for a control to add to your hardware, there are many more options.
Systems like Fanuc and Yasnac can be had at a far greater cost, for commecial CNC machines.
cnczone.com is an online forum for people who are building CNC machine tools, and will have many more resources for control and drive systems.