A liquidation is a process that occurs when a borrower's health factor goes below 1 due to their collateral value not properly covering their loan/debt value. This might happen when the collateral decreases in value or the borrowed debt increases in value against each other. This collateral vs loan value ratio is shown in the health factor.
In a liquidation, up to 50% of a borrower's debt is repaid and that value + liquidation fee is taken from the collateral available, so after a liquidation that amount liquidated from your debt is repaid.
The liquidation penalty (or bonus for liquidators) depends on the asset used as collateral. You can find every assets' liquidation fee in the risk parameter section.
Jack deposits 10 BNB and borrows 5 BNB worth of CAKE. If Jack’s Health Factor drops below 1 his loan will be eligible for liquidation. A liquidator can repay up to 50% of a single borrowed amount = 2.5 BNB worth of CAKE. In return, the liquidator can claim a single collateral which is BNB (5% bonus). The liquidator claims 2.5 + 0.125 BNB for repaying 2.5 BNB worth of CAKE.
Example 2 :
Jack deposits 5 BNB and 4 BNB worth of YFI, and borrows 5 BNB worth of CAKE If Jack’s Health Factor drops below 1 his loan will be eligible for liquidation. A liquidator can repay up to 50% of a single borrowed amount = 2.5 BNB worth of CAKE. In return, the liquidator can claim a single collateral, as the liquidation bonus is higher for YFI (15%) than BNB (5%) the liquidator chooses to claim YFI. The liquidator claims 2.5 + 0.375 BNB worth of YFI for repaying 2.5 BNB worth of CAKE.
In order not to be liquidated, you should raise the health factor by depositing more your collateral asset or repaying part of your loan. By default, repayments increase your health factor more than deposits. It's signficant to keep an eye on the healthy factor and keep it high in order to prevent a liquidation.
Anyone can participate in the liquidations ecosystem. However it's very competitive because the first ones liquidating loans will get the liquidation bonus about 5-15% collateral value (depending on the asset used as collateral).