Ballistic computers are used today but back in the day it was done with a series of wheels aligning various data points. This site will give you a good idea of the potential variables involved, click on the "?" for definitions.
Wind Speed (could vary at multiple distances)
Wind Direction (could vary at multiple distances)
Shot Angle (degrees up or down)
Altitude (effect on velocity)
Temperature (effect on velocity)
Bullet Drop (with all above factors taken into effect)
Target Velocity (for moving targets)
Not to mention they have to be very proficient behind their rifle and know the proper techniques.