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 amounts liquidated from your debt is repaid.
The liquidation penalty (or bonus for liquidators) depends on the asset used as collateral.
To avoid liquidation, you can raise your health factor by depositing more collateral assets or repaying part of your loan. By default, repayments increase your health factor more than deposits. Also, it's important to monitor your health factor and keep it high to avoid liquidation. Keeping your health factor over 2, for example, gives you more of a margin to avoid liquidation.
You should be mindful of the stablecoin price fluctuations due to market conditions and how it might affect your health factor. For example, the market price of USDC 1.00 might not equal exactly USD 1.00, but for example USD 0.95. The price fluctuations of stablecoins, like any assets, affect your health factor.
Yes, liquidations are open to anyone. Liquidators have to develop their own solutions and bots to win the battle and be the first ones to liquidate a loan to gain the bonus. You can find more details in the liquidation section of the Dev Docs.