There are two different aspects of a guns accuracy. Where accuracy means impacting the same point repeatedly. One being the mechanics of the firearm itself and the other being the ability of the shooter.
Firstly here are some things that effect the mechanical accuracy of a gun:
Regardless of the human influences these things effect how tightly a gun will group.
On the human side here's what changes accuracy (alone) and is almost always the culprit of supposedly inaccurate guns.
Now there are some things on the mechanical side that can make properly doing the human things difficult.
Often times people will write off a gun as inaccurate because they aren't comfortable with it or can't manage it. Most guns are as accurate as a human is possible of shooting. But there are firearms capable of tighter groups than others.
If you're associating accuracy with the ability to strike a designated spot with consistency (shooting out the bull's eye) then you take the above listed factors and add: