It's well known that the Apple II was one of the first three prepackaged, preassembled personal computers on the market. It, the TRS-80 Model I, and the Commodore PET all appeared in late 1977.

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,[2] hoping to monopolize third-party development.[3] 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.

A very important factor in the Apple's II's early popularity was school districts buying it to run educational software from MECC like Oregon Trail and Lemonade Stand. But this was not inevitable. A teacher or administrator in a rural school district in 1979 looking to purchase computers would naturally look to the Radio Shack in town, but would only have found incredibly crude Tandy-published software. Even with such handicaps Radio Shack had a substantial portion of the educational market, which after 1980 quickly eroded until 1985, when Tandy had an unexpected second computer boom driven by the PC-compatible Tandy 1000.

* VisiCalc. Because of both of the above factors, 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 disk-based 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] Read this BYTE article from two years after the TRS-80's release (<https://archive.org/stream/byte-magazine-1979-08/1979_08_BYT...>), which a) discusses how to implement machine language graphics and b) complains about the complete lack of Tandy documentation that motivated the author to write the article in the first place.

[3] 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.