There are two ways for a lawyer to be paid by a client for the work they perform. They can charge a client an hourly rate or use a contingency fee. With an hourly rate, a client is billed each month for each hour the lawyer works. Those bills must be paid each month whether the client recovers on their claim or not.
The contingency fee was created to allow the average person access to the lawyer of their choice without the financial pressure of hourly billing. Under the contingent fee, the lawyer has the risk of not being paid if the case does not result in their client being compensated.