Any amount recovered by way of subrogation by the employer, workers’ compensation insurer or this system shall be applied first to the amounts that the employer or its insurer has paid or become obligated to pay. The balance of the amount recovered as specified in Section 20252 shall be paid to, or retained by, this system.