If X works in something low level like device physics then there are a limited number of companies doing cutting edge fab stuff like that. Intel, TSMC, Samsung. The small number of companies limits your salary potential.
It's the same with being a maintenance technician for a piece of ASML 3nm semiconductor manufacturing equipment. You may be highly skilled but if there are only 3 companies in the world that will hire you then your salary potential is limited.
I know about 30 people developing hardware at Apple (writing Verilog, custom analog serdes design) and you can see that their software and hardware salaries are similar. In some cases hardware is higher although I suspect that is because of the limited sample size of salary data at the ICT6 level.
https://www.levels.fyi/companies/apple/salaries/software-eng...
https://www.levels.fyi/companies/apple/salaries/hardware-eng...
There is more to life than money but people who care about money need to look into the companies and salaries before they commit themselves to 4 to 10 years of college.