It isn't the cartridge, nor is it the gun. It's the combination of cartridge, gun, and shooter.
In the hands of the run-of-the-mill shooter, and certainly in the hands of a new shooter, the general run of un-accurized, .45 ACP 1911s, .38 Special revolvers, and 9mm semi-autos will put bullets close enough to where they need to be at any distance out to 15 or 20 yards.
Shooting past 25 yards, and certainly out to 50 yards, will require a well-prepared and accurized pistol, if the user wants to make well-placed center hits on bullseye targets. However, this can be done with "ordinary," right-out-of-the-box, .45 ACP, .38 Special, and 9mm cartridges. Of course, it also requires an experienced shooter with a steady hand and excellent technique.
The .45 ACP cartridge is not much more inherently accurate, all by itself, than is the .38 Special, the .22 Long Rifle, and maybe even the 9mm Parabellum. All of those will make good center hits at 50 yards, given a well-prepared gun and an experienced shooter.
That being said, the .45 ACP and the .38 Special, if very carefully manufactured or reloaded, and shot out of very well prepared pistols in the hands of very experienced target shooters, do have some amount of ballistic edge over other .45 and .38 cartridges, and the 9mm.