Bike shops play by different rules. The industry and vendors collaborate to block big stores. You
cant get a Colnago or pinarelo or any top end bike at Walmart or web Walmart (amazon) you have to go to a bike shop and said shop is expected to perform certain services as you buy that bike. They fit it, they assemble it properly, usually tune it after a few rides, etc. the wholesale price has a price cooked in for assembly and those services. There are industry groups that aggressively police it. The small shops are, in essence, representatives for the vendors. There are also agreements that strongly control what's on the floor, a Specialized shop very rarely has Cervelo, BMC, or Trek bikes too, some might but generally the vendors don't allow it.
It changes periodically, Giant, Specialized and Trek are big enough that they are doing their own stores and performance shops and not relying on small dealers as much. It's also different from many other things in that a misassembled bike can result in death. The industry as a whole supports bike shops though