A stupid question I think

What the difference in a 401k and a pension and why don't all companies have them. And which it better.

P.S I never really had an adult to sit down and talk about insurance and retirement. Been kinda trying to figure it out on my own