As far as I know, the only way to self petition for an extraordinary ability (EB1) based immigration, but that probably applies only to a small percentage of H1B workers. The rest are bound to their employer applying to grant the employees immigration benefits, which the employer may or may not do.
In theory, yes. But there's a massive backlog, depending on your country of origin. I know somebody who graduated in the US and after 10+ years they gave up trying to obtain a green card in the US and instead applied for permanent residence in Canada -- within a year they had moved with their family. This is far from unique.
- The cost of sponsoring someone for a green card ($50k?) is low compared to engineering salaries.
- Many companies like Google have great retention and the probability that an employee leaves after getting green card is low.
- Companies that are worried about retention often have employees sign a reimbursement agreement when starting the GC process. Something like, if you leave within 2 years of getting the GC you pay a prorated portion of the legal fees.
- In a tight labor market, GC sponsorship is another benefit like compensation, and companies offer it to hire good people. Over the last few years companies like Amazon have changed their GC policy to sponsor folks from day 1 of employment in order to hire people for whom a GC is that important.