Saying that Walmart has "notoriously bad margins" makes it sound like they're working at a disadvantage. Walmart's margins aren't low out of necessity. Their entire business is purposely built around low margins, and refusing to hire full time employees with benefits, etc. It's intentional on their part - there is no sob story about margins there.
Same goes for Amazon et al. The business strategy is to crush every small retailer by operating at slim to no margins, purely to make it impossible for anyone else to compete.