The economy does not reward people for how smart they are, how impressive their credentials are, or how hard their skills were to learn. It rewards people who solve problems. Preferably problems that other rich people have. Many, many, many more rich people have website problems than PCB circuit board problems. Ergo those that can solve website problems make more money.
Doing something difficult can be a way to make a lot of money, because it restricts supply and is a competitive moat. But low supply is a winning recipe when coupled with high demand. The supply of string theorists is low, but so is the demand.
If you’re going to do something difficult make sure that it’s something that lots of rich people need. For example being a hedge fund quant is a really well paying job because it’s both difficult, and highly in demand because every rich person on the planet wants higher returns on their portfolio.