The following illustrations demonstrate how a magazine fed rifle works.
To load a magazine fed rifle, the magazine is filled with cartridges and inserted into the magazine well until it clicks into place. The bolt handle is then lifted and pulled back as far as it will go, this cocks the firing mechanism in the bolt. As the bolt is pushed forward, it pushes the top cartridge forward until it clears the magazine lips and starts to enter the chamber.
As the bolt is pushed fully home, a recess on the bolt face encloses the end of the cartridge. A section of the rim of the boltface consists of a sprung clip that clips over the rim of the cartridge case. As the bolt is almost closed, the base of the cartridge pushes a small sprung button, called the ejector, back into the boltface.
As the bolt is fully closed in the downward position, the locking lugs rotate into recessed channels in the end of the chamber. A solid lockup is essential as when the cartridge is fired, the case exerts as much rearwards pressure as the bullet does going forwards.
Once the shot is taken, the bolt handle is lifted and pulled backwards. The empty cartridge case is retained on the boltface by the clip section of the boltface rim and as soon as the case is free of the ejection port, the ejector flings the case out of the rifle through the ejection port opening.