CompUSA had really, really high prices, poorly designed stores, and basically didn't adapt to "computer stores going mainstream" nearly as well as Best Buy did.
In addition to all those issues, Best Buy happens to have an excellent customer relations strategy in the form of the "Geek Squad". On this forum, most people probably turn their noses up at it, but in a world where tech-illiterate people often face long hold times with someone who is unhelpful or who may not speak english well, being able to bring your laptop in to a real person is a HUGE advantage.
Best Buy has not really tried to court the computer-savvy market; as soon as internet commerce became viable they knew that market was going to defect. They concentrate on the average person, and stock enough items that the sale prices lure people in even if the average price is higher. They've also gone out of their way to make a serious customer service turnaround in the last 4-5 years.
Honestly, if CompUSA wasn't going out of business, I would have been putting even money on CompUSA vs Circuit City as the first one to get KO'd against Best Buy/Wal-Mart/Target.