In the situation where one has an amount of money (whether amount is known exactly or approximately) with him which doesn't belong to him but he either doesn't know the owner, or he has absolutely no access to him, or in the situation where he took someone's belonging without permission and used it/ate it, etc.. such that it is not available anymore and he also has
no access to the owner, in both situations he should give this money to the office of the Marj'a so that they can give it to charity (or give it to charity himself with the permission of the Marj'a. based on precaution, according to Ayatullah Sistani).
As for its role in the discharge of social justice, this is a lengthy discussion beyond the scope of this platform. Kindly refer to books on this subject.