Companies are only allowed to use H1-B visas to bring in foreign workers when there are no native workers who can fill the role, but they are actually using them to replace their existing native workers. In most cases, the native workers are being forced to train their foreign replacements. H1-B applications in those circumstances are fraudulent.
You might want to look into the H1-B loopholes. As with so many governmental programs, it’s a complex system that allows those with the”right” connections/situations to legally skirt what we are told the rules are.