A cartridge has :
3. gunpowder or other chemical
A pistol is a type of handgun and works on Newtons third Law.
i.e : Every action has opposite and equal reaction
When a hammer with high pressure hits the gun powder via primer ,it explodes and bullet progresses through the barrel and hits the target.