Smith is the original word for working with metal, making all things metal from tools, to blades for kitchen and war, to horseshoes, etc. And repairing them. Nowadays a blacksmith. As a blacksmith couldn't do everything equally well and focused on larger stuff not as finely finished, others specialised from there.

A gun smith is thus a person who makes guns and repairs them, thus a gunsmith. Lock, stock, barrel were the components and mainly still are. If you look at the lock on an early muzzle loader and compare it to a craftsman's lock you will see the specialisation that took place.

Anyone not qualified or able to build a gun from the bare essentials is actually not a gunsmith. Let's exclude making the barrel and receiver from this although they should be able to do this. A machine operator/fitter and turner may become a gunsmith either by experience or further training, or possibly from self learning.

With this in mind, I would broadly describe a machine operator someone who turns out a large number of identical items, a workman similar or combining items into a finished product. Example, the machine operator/workman in a car manufacturing plant isn't a mechanic except if qualified separately.