Just briefly, there are two basic types of auto pistols in general use. The first is the blowback (sometimes called "straight blowback") in which the empty cartridge is blown out of the chamber by gas pressure from the burning powder. This type of pistol is "locked" until pressure drops, only by the weight (mass) of the breechblock, usually a slide or bolt. The spring, unless heavy enough to add to the mass, serves only to slow and return the breechblock; it does not lock it. Blowback operation is feasible only with low power cartridges (.22, .32, .380) or very heavy breechblocks. With higher power rounds, the breechblock may open too soon and the high pressure gas will burst the cartridge case.
The other common type is the "recoil operated" pistol, used with higher power cartridges. In this system, the barrel and breechblock are locked together until the pressure drops enough to allow the breechblock to open. The barrel and breechblock move to the rear together, reacting to the recoil from the bullet moving forward, not from the pressure in the chamber. The breechblock is then unlocked from the barrel in some way (in the 1911, a link draws the barrel down out of the locked position) and the breechblock continues to the rear to extract the empty cartridge, eject it, and feed a new round from the magazine.
HTH
Nitpickers note: No, I did not forget about the various delayed or retarded blowbacks or gas operated pistols. I wanted to limit the reply to the common types. And for the fellow who once challenged me, yes, a Luger is a recoil operated pistol.
Jim