Or wait a second, I guess it isn't public knowledge doctors make a lot of money.
To answer the question as coldly as I can:
1) Women are graduating from nearly all University programmes more than men.[0]
2) The role of Doctor is not as highly paid or prestigious as it used to be, at least in Europe.[1]
[0]: https://www.pewresearch.org/fact-tank/2021/11/08/whats-behin...
[1]: https://www.paragona.com/healthcare-jobseekers/where-would-y... ; cites a 70k average where a project manager will make an average of 99k: https://www.glassdoor.com/Salaries/stockholm-project-manager...
Sibling already pointed some things out. Specifically for doctors, go ahead and look up what specializations men go into primarily and what specializations women go into primarily. The only high paying one I noticed being particularly female-dominated is dermatology, and it's not that much of a difference. The male-dominated specialties tend to have far more high earning specializations, and the ratios are far more skewed too.
As for lawyers, I can't speak except for the fact lawyers work more akin to salesmen and make a lot of money based on performance, and once again, historically speaking, men have always dominated on anything performance-based. Law is an exception, and it's an extremely poor one at that.
As for both, both medicine / biomedical sciences and law pale in comparison to every other field known to both pay well and do so with high security still being largely in favor of men, whereas fields with low pays and low security tend to be dominated by women. Most STEM fields women dominate aren't known for paying well compared to the ones men dominate. Comparing those fields to social sciences is a no-brainer. All of this still excludes entrepreneurship and high-paying blue collar work still being dominated by men.
None of this exempts the fact historically, women have never chased money through career nearly as much as men, and have always placed far higher value on a man's status than vice versa. There are cultural reasons why this has changed, and none of those reasons are necessarily pointing towards improvements. We can open this entire can of worms if you so desire, but it will go far too off-topic for this.
What's fascinating is how people are trying to avoid talking about the obvious motivator for men not present in women, and how the slow death of that motivator is affecting things.
Take a look in the mirror before trying to subtly call someone ignorant, would you?