First is putting the bolt in a vice and using a mill with an annular cutter (like a coring bit) to remove material around the center of the knob.
Second is a special jig in a lathe. The jig orients the handle to the center axis. Then the knob just gets turned down to the proper diameter, then threaded while still in the jig.