Lawyers are one of the few workers who get paid proportionally to the value they produce. It's just that the value they produce has grown exponentially high since they represent people and corporations with ridiculous sums of money.
A good example is the case where Elon Musk sued the law firm that the former Twitter owners used to force Musk into buying Twitter. Musk argued that the $90 million payment to the law firm was way too much money. The law firm argued the deal was worth $44 billion, making their payment just 0.2% of the value they created for their client. Courts agreed the law firm did not overcharge.
If each worker for Amazon got paid 0.2% of Amazon's yearly revenue, they'd all make over $1 million a year. The problem is they have so many employees that Amazon can't actually give each of them 0.2%.
Another example is the two Trump defamation cases. The first case was put on hold because he was president. The second case was after he was no longer president. Courts eventually ruled both cases could proceed, so it was a rare time when someone got tried for the same thing twice. Trump used two different lawyers when arguing these cases. One case resulted in a $5 million decision and the other resulted in an $83.3 million decision. It's a great example of the value of a good lawyer. These cases were identical except for Trump's lawyer. One lawyer can generate $78.3 million in value. It's hard to find any other profession where a single person can generate that much value in a few months.