The most common CNC machines are milling machines, lathes, and grinders. Milling machines automatically cut materials, including metal, using a cutting spindle, which can move to different positions and depths as directed by the computer instructions. Lathes use automated tools that spin to shape material. They're commonly used to make very detailed cuts in symmetrical pieces, like cones and cylinders.
The code used to program CNC units is generically called G-Code. It contains information about where parts of the machine should be positioned, and tells the machine exactly where to place a tool. Other instructions tell the machine additional details, like the speed a part should run at; how deep it should cut, burn, or punch; and the angle of an automated tool. Most modern industrial CNC machines are tied into a network of computers, and receive operating and tooling instructions via a software file.