Free Software licenses don't restrict profit making, even the AGPL wouldn't stop Amazon from using the same strategy to beat those OSS companies in the market.
That is incorrect, the FSF licenses would require Amazon contribute code forward to their users, not back to the project.
Also, Amazon were already contributing code back when these companies changed their licenses, the companies don't care about code contributions, just money.