A CNC machine allows you to develop a piece after designing it in a computer, although it's not the only use. Engraving, carving, printing, ... The simplest one has a motor with a rotational head for cutting materials while others employ lasers or even water for the same purpose.
There are several kits available for making your own, with all the necessary pieces or basically with motors, their inherent controllers, interface for PC and power supply. The operation in really simple, with a motor for each axis. Any axis has a guide with, normally, a leading screw for translating rotational to linear movement. So, some metal for the guides, some bearings, wood, time and tools and that's it!
After constructing the machine, it's time to use the computer for designing pieces and learning the way of connecting the computer with it. An easy task because the kits commonly include software of this kind. There's available free tools to export files in .dxf format, one of the most widely used. There is a plug-in for the open source design program based on vectors called Inkscape that works very well.
As always, there are different aspects to learn by experience, but once the machine works it's really nice to see how we can create machines for giving us interesting results without nothing bad to mention!