It does not mean you have tenure, or any non sense like that. It means there are specific, objective causes to terminate your contract, which include but may not be limited to: gross incompetence, contempt for workplace discipline, frequent absenteeism, criminal/delinquent activity against or otherwise involving company assets, etc.
If the employer cannot or will not prove this kind of behaviors from the part of the employee, he still can terminate the contract, but there's a minimal severance mandated by law, which depends both on current monthly salary and on seniority.[1]
i.e In my country, you are supposed to get 3 months salary, plus 20 days per each full year you held the position. Some employers will still low ball you if they think they can get away with it, but they will still give you more than what you'd get after suing and paying the lawyer's commission.
As a more concrete answer to your question, professional athletes do it all the time. The elite among them get the longest-term contracts, and actively push for them. There are other jobs as well that involve guaranteed terms, many of which don't have the unique attributes (limited prime years, injury risks) associated with being an athlete. Those same athletes' coaches, for example. Actors. Corporate-to-corporate contracts often have minimum terms and guaranteed spend, too.
Why would the company offer such terms? I think the OP covered that pretty well. Turnover is expensive.
Employees generally don't get that kind of consideration - especially in established companies. Companies used to have incentives such as pensions that were a generally applicable, long-term retention incentive. However, the market decided that carrying that type of long-term obligation wasn't desirable for companies. In some ways workers benefited too by lowering of their employment switching costs and not carrying the risk that a company doesn't survive or honor those obligations.