Everyone who works has to pay Social Security taxes on their earnings. Employers and employees pay social security taxes, and self-employed individuals pay twice as much, being both employer and employee. You pay Social Security every year for as long as you work.
So what do you get in return for shelling out all this money to the government? Once you stop working for a legitimate reason, like retirement or injury, the government supports you with the money that was collected in Social Security taxes. In addition, because you were the one paying all those taxes for so many years, you don’t have to be in desperate need of funds to qualify for Social Security – you have a legal right to those benefits.
There are certain terms and conditions, of course. People who earned more money throughout their lives paid more money in Social Security taxes, so they have a right to higher benefits. However, Social Security is weighted in favor of workers with lower lifetime earnings and workers with families to support. This means that even though the wealthier may get higher absolute benefits, low wage earners get more money relative to how much money they paid throughout their lives. The goal of Social Security is to prevent those who have stopped working from becoming poor, but it isn’t a charity: you’re paying the government when you’re young and healthy so you can use that money when you’re not.