The wisdom behind the prescription of collateral (rahn) for loans
Question

What is the reason why collateral (rahn) is required for a loan in Islam?
Praise be to Allah.In Islamic teachings, collateral (rahn) is property that serves to guarantee payment of the debt, so that the lender can recover what he loaned if the borrower cannot pay what he owes.
Collateral is permissible according to the Quran, the Sunnah and scholarly consensus.
In the Quran, Allah, may He be exalted, says (interpretation of the meaning):
{If you are on a journey, and cannot find a scribe, then something should be handed over as collateral}
[al-Baqarah 2:283].
In the Sunnah, it is soundly narrated that the Prophet (blessings and peace of Allah be upon him) bought some food from a Jew to be paid for at a later date, and he gave him an iron shield as collateral (rahn). Narrated by al-Bukhari, 2068; Muslim, 1603.
The scholars are unanimously agreed that collateral is permissible in principle.
See: al-Mughni, 4/215; Bada’i` as-Sana’i`, 6/145; Mawahib al-Jalil, 5/2; al-Mawsu`ah al-Fiqhiyyah, 23/175-176.
The jurists are unanimously agreed that collateral is something that is permissible, and that it is not obligatory.
Ibn Qudamah said in al-Mughni, 4/215:
Collateral is not obligatory, and we do not know of any scholarly difference of opinion regarding it. End quote.
So the lender does not have to accept collateral from the borrower.
The wisdom behind prescribing collateral is that it is one of the means by which the lender can guarantee that he will recover his loan. Just as Allah enjoined securing the loan by writing it down, He also enjoined securing it by means of collateral.
So when the time comes to pay off the debt, if the borrower refuses to pay off the debt or is unable to do so, the collateral may be sold, and the lender may take his due, and if anything of the price is left over, he should give it back to the debtor.
Collateral is one of the beauties of the Islamic system of law, because it serves the interests of both the lender and the borrower.
The point of that is that the lender is guaranteed that he will get what is owed to him, and this will encourage him to lend to his Muslim brother, so the borrower will benefit from that, because he will find someone to lend him money.
But if collateral was not allowed, this would prevent many people from lending, for fear of losing their wealth.
See: ash-Sharh al-Mumti`, 9/12 1.
And Allah knows best.