With so many companies making shoes there could as easily have been a shoe size scale for each company but there isn t. Because shoe companies voluntarily organized themselves in a way that is mutually beneficial to all of them. Shoe companies, like other companies, might be selfish but they are also rational. Their rational self-interest resulted in industry standards that prevented chaos. The computer industry affords another example.
Computer companies meet from time to time to create industry standards.
HTML is an example. Multiple browsers can read the same web pages because Microsoft, Netscape, and other companies were motivated by rational self-interest to create industry standards. This is not to say that such cooperation is perfect. Consider the monopoly charge. Simply having a free market does not mean there is a natural and inevitable trend towards monopoly without government intervention.