Foreigners pension may be refunded after they left Japan

I often hear from foreigners working in Japan that they do not like to pay pension in Japan because they are unlikely to receive it because they will return to Japan in a few years.
However, as long as they meet the conditions for joining the Employees’ Pension and Health Insurance plan, they must join the social insurance through the company and make contribution.
You may think that it is a loss of payment, but if they continue to pay the employee pension for more than 6 months, the amount close to the amount they paid will be refunded after they left Japan and claim for their pension refund within 2 years after they left Japan. However, the amount of this pension refund is the amount which they have contributed for up to 3 years at most.