Generally, the source of the surplus defines the ownership of it.
Examples:
If pensioner investments were not used to keep pensions in line with inflation, then the surplus created as a result would belong to the pensioners.
If the company is accountable for making good any deficit caused by excess ill-health claims, then a surplus as a result of these claims could belong to the company.