They can get social security even if they haven’t paid in?
It's funded from regular tax revenues, and it's paid to people who do not have sufficient credits to get Social Security, including disabled young people, and elderly Americans who qualify for some Social Security, but are below a minimum monthly payment.
Disabled immigrants with Green Cards also qualify for SSI.