What happens to Social Security contributions once an H1B goes back to their home country?

US does not have Totalization agreements with many countries (example: India), so what happens to the SS contributions after an H1B goes back to their home country? I know that H1B are eligible after 40 quarters (10 years) of contributions, but I don’t think it applies to Indians.

Can someone share their experience or knowledge in this matter?