At the end of the period, if he could not pay he was beheaded. Punishments became less harsh over time. If you defaulted in Victorian England, you went to debtor’s prison. Today, the borrower typically only forfeits the assets that have been financed, and sometimes personal property too if he is not protected by limited liability, unless he has acted fraudulently.
Why should the lender not share in the losses to the full extent? That is because he is not a full managing partner in the enterprise. In return for not sharing in the large profits if the enterprise does well, the lender is absolved from sharing the losses when it does badly, to the extent possible.