"The H1B visa is a visa for a worker on a position for which a company fails to hire a worker in the US."
The H1B visa application has no requirement to try to recruit US workers which makes it easier to game the system to pay the lowest wage possible.
Practically true - but that it’s not permitted to count experience gained while working on an H-1B when applying for a green card.
If an application for a green card is made for a person who’s currently in the USA on a H-1B visa, the person needs to qualify for it based on their qualifications and experience prior to whatever they’ve done in their current H-1B job.
There is no "5 year" requirement to get a green card. A company can even sponsor an employee from abroad (e.g. a satellite office) to get a green card and if approved they will be a permanent resident the moment they arrive in the USA.
Perhaps you are thinking of the five years of a green card needed to apply for citizenship?
I still think that you mix up the "green card" and the "H1B visa".
The green card is a status of a permanent resident. A person legally living in the US for enough time (5 years or so) on a variety of visas can apply to get it. It costs significant money so an employer usually helps with that.
The H1B visa is a visa for a worker on a position for which a company fails to hire a worker in the US. That worker may become or not become a permanent US resident afterwards.