There are at least two quartering machines still around. The Durango & Silverton has one and Grand Canyon Ry has the one that used to be at the Southern shop, shown below. There may be others that I am unaware of.
The axle is held between centers and the pins are machined with the cutting heads located at each end. The cutting heads will precisely locate the crank pins at 90 degrees. The pins can either be turned true or the holes in the counter weights can be bored for new pins. The quartering machine was commonly used any time the pins needed to be turned, replaced, or the wheel was removed and reinstalled on the axle.
Even with the axles and counter weights keyed, it is difficult to get things pressed together exactly in the correct position each time. Key ways wear over time and there is always a little play between things. Also, with a new axle, the new key ways must be machined exactly in the correct locations. Any small errors there will show up in out of quarter pins. It is frequently necessary to re-quarter the pins after reassembly.