Lawyers are compensated for the time they spend on legal matters by billing clients at an hourly rate. Hourly rates depend on the complexity and experience of the matter.
Because they have built expertise over many decades, the most skilled lawyers charge higher hourly rates.
A less experienced lawyer might be able to charge lower hourly rates, as he/she is able to efficiently handle cases.
Some lawyers are compensated for handling particular types of cases. In some cases, lawyers representing criminal defense may be eligible for bonuses if their case is successful.