Among the resources shared by LEGO today to mark the minifigure's 40th birthday are photos of the moulds used for their manufacture and a video showing them being assembled and printed.
We tend to take them for granted but the video will give you a new appreciation for just how involved producing them is. The wall of parts shown towards the end is particularly interesting.
Assembly and printing
A fascinating video showing the component parts of the torso and legs being assembled and printed:
The basic minifig is assembled from nine pieces of plastic, all of which have to be moulded separately, of course. Here are photos of the moulds used: