There’s a variety of manufacturing methods used to create machine parts.
The “simplest” is to create the parts from stock material in a workshop, piece by piece, using lathes, mills, etc to precisely machine down each piece to the required specifications.
When designing a machine, the entire thing will be modelled in CAD, with each part being inspected for conflicts with other parts.
From this CAD model, parts will be assigned tolerances, which will determine the minimum and maximum size each part can be and still work.
As for measurement, measuring tools are calibrated against known standards, so that each tool agrees with each other. There is some tolerance in this process, which needs to be understood.
This is a very simplistic look at design and manufacture.
Latest Answers