H-1B for top talent in fields like AI makes sense. But in most cases it's not being used for that. It's just being used to fill generic software jobs that can be filled by US citizens/residents.
The program is also used to employ people that won’t quit when they are mistreated because their family’s existence in the country depends on continued employment.