In addition to the well stated factors that are listed already, there are some very practical areas that probably make more impact than things like barrel length.
Theory and manufacturing techniques aside, you might find two rifles with identical specs off the same assembly line on the same day with the accuracy variations you pointed out. That doesn't mean one rifle is a complete dog, it may just mean that that one particular dog doesn't like to eat the same ammo as the other.
Other than triggers not acting the same, the single biggest factor is the barrel / stock combination that sets the harmonic for the rifle. The combination make most rifles very sensitive to the implulse of the powder ignition event and could make the difference in the results shown in accuracy. Contrary to many shooter's beliefs, buying for maximum velocity is usually the way to decrease accuracy. Of course, it improves hitting energy and flatness of flight, but it may make the rifle less accurate, although not always so inaccurate that the results wouldn't be worth it for hunting particular game.
If there is binding in one stock / barrel combination and not in another, the one with the binding will probably not be as accurate as the other.
Also, the length of the chamber can vary just a few thousandths and make one rifle more accurate with standard depth seated factory ammunition and another much more accurate with deeper seated ammunition.
I have had rifles that just wouldn't shoot accurately with factory ammunition of a particular weight and, when tuned to the rifles harmonic, shot better than any other weight, hand loaded or factory.
Case in point:
My buddy and I have virtually indentical Savage 10 FP rifles in .308.
His does not shoot, or even chamber, 168 grain cartridges set for 2.810 overall length. Mine does and shoots them very well at its preferred velocities.
His rifle shoots factory 168 grain ammo great.
Mine shoots the same ammo OK but with a 0.15 inch larger average.
Mine shoots 150 grain ammo (preferred load) at under 0.5 inches.
His doesn't shoot 150 grain ammo very well.
His shoots Lapua Scenar 167 grain factory ammo under 0.55 inches (factory seated at 2.790 inches with 2690 muzzle velocity.)
Mine shoot the same ammo for an average of 0.876 inches.
Mine averages under 0.58 inches for over 9 different loads with velocities of 2630 fps and 2666 fps with 2.805 to 2.810 overall length over hundreds of measured groups.
His averages 0.620 with diffferent loads for hundreds of groups.
They are both great rifles, identical in specifications, but are somewhat different in their preferences. If you happened to pick the ammo one rifle didn't particularly like, you would call it a dog in comparison to the other.
But as you tried a variety of ammos, you'd then recognize their preferences and focus on tuning loads for each rifle to account for those preferences.
I just don't think that for a newly manufactured rifle with a good trigger and without the serious defects that are listed in the other posts would necessarily always be a sub MOA or greater than MOA rifle, unless the manufacturing tolerances are really out of whack.