It's not well known that the Apple was not the obvious winner of the three; the TRS-80 was. Every small town in America had Tandy's Radio Shack stores, and even if Radio Shack had a reputation for selling toys and gizmos as opposed to computers, it had a reputation. As a startup, Apple didn't. Commodore wasn't as well known as Tandy but was an established calculator and office-equipment company, with its own semiconductor fab that produced the 6502 CPU that Apple and other rivals used.
And, in fact, until about 1980, the TRS-80 dominated the market. What happened?
* The disk drive. All three computers only used tape storage in 1977, but their makers soon provided disk drives. Tandy's drive is a horrible, unreliable kludge. Commodore's PET disk drives are gigantic monstrosities that are fast and reliable[1] but far too expensive. Steve Wozniak's Disk II is a combination of a brilliantly simple and reliable disk controller, and inexpensive-to-make (and thus highly profitable) drive mechanism, that still run well today, 40 years later.
* Third-party products. Apple published everything needed to create software and hardware for the II. Its slots invited engineers to design cards. The TRS-80 came with a superb BASIC tutorial, but Tandy otherwise kept all technical information secret, hoping to monopolize third-party development.[2] Radio Shack stores were not allowed to sell non-Tandy products, and couldn't carry third-party publications like 80 Micro that by default became the major way companies sold TRS-80 products (since other retailers didn't want to compete with Radio Shack stores). Commodore's Jack Tramiel never ever understood the importance of software development, and the PET fell far behind Tandy and Apple in the US; until the VIC-20 in 1980 most of Commodore's computer sales were in Europe and Canada, where Apple and Tandy didn't compete.
* VisiCalc. Because of the above, VisiCalc was written for the Apple when market share should have caused it to be written for TRS-80 (Dan Fylstra of Personal Software, VisiCalc's publisher, was one of the first owners of the TRS-80). Being only available for Apple massively drove sales of the II; for the first time, people bought a computer to run a specific killer app, as opposed to the other way around. In turn, others chose the II to develop for
Even after 1980, when Apple had clearly gained sales momentum, Tandy still had the bulk of the installed base. 80 Micro's December 1982 issue (https://archive.org/details/80-microcomputing-magazine-1982-...) has 484 pages. I'm pretty sure no Apple magazine ever came close to that thickness; the only other computer magazines in history to be that thick are 1) PC Magazine before it went bimonthly in 1984 after the December 1983 issue hit 800 pages, and 2) BYTE. Wayne Green, the publisher of 80 Micro, had by that time written editorials in almost every single issue pleading with Tandy to encourage third-party developers. Tandy didn't relent until the Model 16, introduced that year, had zero third-party software after six months. But by then it was too late.
As fat as they are, reading Tandy magazines like 80 Micro and Rainbow (https://archive.org/details/rainbowmagazine-1983-12/) from the early 1980s is like visiting a sad and barren alternate world; instead of Origin, Epyx, MicroProse, and SSI, there are much cruder-looking ads from tiny companies offering bad clones of popular arcade games.
[1] Two virtues Commodore's later drives did not retain
[2] It's clear in retrospect that TRS-80 was intentionally designed to not be compatible with the existing 8080/Z80 standards. ROM's location in the memory map broke CP/M compatibility, and the expansion bus is not S-100 compatible.