The money can be invested, and then at some age (55.5 i believe?) you can access the money without being taxed. There is a maximum you can contribute per year etc etc.
I am not old enough to ever have had a pension option in my entire life, but I believe 401Ks are overall worse, because pensions come w/ some amount of guaranteed payout + someone managing the fund to ensure that happens. a 401K can go to zero, and you can forget to contribute (and most of the money is your own money anyways)