There are a number of factors that contribute to a gun's accuracy and a shooter's precision.
On the gun side of things there is ignition, optics quality, stock flex, bedding, headspacing, bore condition, chamber dimensions, etc... The list can go on and on. Then you have ammo...