There are 2 issues:
1/ Employment provides training and experience. If the h1bs are given access to the jobs (training and experience), then is it the American's fault that they are no longer considered "best"?
2/ h1b increases labor supply, not the demand. More supply, means lower wages for everyone.
1/ Training is only effective if you can fill the function of the job and learn from it. Many software engineering jobs people claim are stolen by H1B hires are filled by human beings more likely to meet the bar. Many American candidates just don’t. Filling a software role is hard.
2/ Demand for software is not static. Good software drives demand for more engineers in many cases, intra or extra-company. There is probably a non zero rate of wage suppression per marginal h1b currently. But an American economy with no h1b employees could feasibly have a much lower average sde salary. It is not an Econ 101 problem.