In some trade that involve a lawyer, the A side will deposit money to the lawyer and the lawyer will pay to B side when B side completed what is written on contract. In Hong Kong, the lawyer can keep the interest generated as long as the amount is less than HKD500
The way it works in my jurisdiction is that the lawyer either needs to have the interest be part of the funds being held, or the interest goes to a Interest on Lawyer Trust Accounts which help pay for legal aid for those who otherwise couldn't afford it.
As with anything relating to law, though, the law works differently in different places. Even when you expect things can be different, it can still surprise you how different places can be.