Some players leave the NFL willingly. Those players retire from football. That was the case earlier this offseason with quarterback Tony Romo. The Houston Texans certainly would have taken a chance on Romo, injuries and all, to be their quarterback if Romo had not opted for the relative safety and security of the CBS broadcast booth.
Far more often, the NFL retires players. It happens all the time in training camp transactions that hardly anyone notices. It happens during the offseason when free agents are unwanted. Players exit the sport simply because their on-field services no longer are in demand.