What is the purpose of compensatory work in the historical emancipation rule?

Kitab al-Hajr: Improvidence, Legal Restriction, and the Age of 25