A pistol is a handgun. The word may be used broadly to mean any handgun, or narrowly to mean only a magazine pistol, as distinct from a revolver.
In a magazine pistol, the cartridges are in a magazine, which is a metal or plastic box. The magazine is usually inside the handle of the pistol. When the pistol is fired, the empty cartridge pops out, and the next one comes up into position. The magazine is spring-loaded so it pushes the next bullet into place as the empty cartridge is ejected. For that reason pistols are sometimes called "semi-automatic". When the magazine runs out of cartridges, it can be reloaded by inserting more cartridges.
The term has long been variously used. For example, in the American Old West revolvers were used but were then (and even today by some) called pistols.[1] The word "pistol" entered English before 1600, from the French. At that time it usually meant a single-shot handgun.