Of course some[0] don't earn their wealth, but their wealth was earned by someone else still providing value. They got the output for nothing, but it was still earned.
There are some people, such as Vladimir Putin, who just drain their country of its resources, enabled by the force of the state. But capitalism is about free exchange of value. So if someone gets rich; lots of other people got value.
[0] https://en.wikipedia.org/wiki/List_of_female_billionaires#20...