The extractor moves with the bolt to pull the cartridge case rearwards out of the chamber, and at some point the ejector eccentrically exerts a frontal push (from the case's frame of reference), which torques and "flicks" the case out of a side opening on the receiver known as the ejector port.
What part of the gun ejects the bullet?
Ejector: The mechanism on a firearm which ejects or expels a cartridge or cartridge case from a firearm.
What causes a casing to eject?
This could be due to switching to lower-pressure rounds, a bad batch of factory ammunition or a poor handload. Another common cause is the recoil spring. If you're using a recoil spring with too much tension for the ammunition you're using, the slide will cycle faster than the spent case is sent out the ejection port.