The reason engineers don't cost this much is that lawyers are lawyer brained smooth talking networking types who hold together tightly and have a quid pro quo system and you have to pay protection money to their mafia. Law is based on rubbing elbows in the right places, playing tennis and golf with the right people and in case of jury trials, on acting convincingly and exuding a certain image to manipulate their emotions. Engineers are too autistic to hold together end rent seek this much.
But some engineers do make that much. I say this as a fellow software engineer: why do so many of my colleagues think every other profession is worthless bullshit? BTW, statistically, SEs and Lawyers earn about the same...
The top of top frontier AI research talent maybe makes 2M and I'd guess you have at most a few hundred such people globally but maybe just a few dozen.
Non "FAANG" (or whatever the new term is) software engineers often make sub-100k even in the US. And regular sw engineers won't break above 500k unless they are managers heading some large team or branch. Getting over 1M is almost superstar level as a sw engineer. If you think it's common, you must be in a tiny SV bubble.
I said some, and pointed out that on average SE’s and lawyers get paid about the same. This conversation started on IP litigators, who generally have a BS degree in a related field and often times experience in the industry they practice, so yes they are amongst the best compensated.
Aside, but IP is a propaganda term. These laws are not property rights, their purposes are varied and usually have the wider public as the beneficiary in their reasoning for existing, it's not like ensuring right to actual property.