It's not a cut and dried subject. Two offer a couple metaphors... car manufacturers don't owe anything to the horse whip makers they put out of business, but at the same time it's a really bad idea to eat your own seed corn. It's one thing to out perform a competitor with a superior product, it's another to undercut a business partner who performs a role essential to your own long term success.
Both dynamics apply to this case, but WotC has obviously decided that in the balance the LGS are more of an essential business partner than they are a competitor, and acted accordingly.
This is in part because of vastly different monetization schemata for the two most profitable Hasbro IPs.
They've tried to monetize D&D on a booster-pack model in the past - Fortune Cards and D&D Miniatures come to mind. But In 5e, randomized booster Miniatures are gone, because it's just too niche of a market, and those who actually want to buy the minis nowadays know what they want to get and just get what they want to get. For that reason, WotC outsources the Minis to their partners at WizKids, as they also have with the non-randomized 5e power cards (the descendants of 4e's Fortune Cards and 4e & Gamma 7's Power Cards). These are still nice to have, but people don't want a random deck of heroic inspiration events. I still think it was a cool idea for a deck building module for D&D, but it was a REALLY big flop because D&D players want to build their character, they don't want to be surprised or have to dig through a sea of other creatures/powers in countless booster packs to get their core features.
Magic the Gathering works differently because it has room and economy for FLGS to buy and sell desirable singles, for WotC to put out powerful and useful Commander Decks and Starter Kits with predetermined cards, and for multiple levels of rarity balanced randomized booster packs. But more importantly, the randomization feeds into the core ideas of the game. You've got a semi-random Deck of spells that you may or may not draw in time. And two of the 3 most popular forms of the game are sealed booster and limited booster draft (the third is Commander which isn't usually played with sealed boosters, save for Commander Legends). Sealed Booster events further up the semi-randomness of the game by having you build your spell book from resources you don't know what you're going to have. That's a VERY different sort of gameplay than D&D lends itself for.
Mind you, I think there's room in D&D for randomized characters (like a Gambit or Domino style Gambler/Luckbender/Fateweaver type character). But Wild Magic Sorcerer & Barbarian do that in a more D&D way, using dice and tables, and trying to turn D&D into Magic's monetization strategy has always thus far led WotC to conclude that the "Juice isn't Worth the Squeeze" (see Maro's most recent Drive to Work podcast for the definition of that idea).
Magic frankly doesn't NEED FLGS, because WotC can sell direct to consumers and people don't need to meet others to play it because they can emulate the game nearly perfectly with Arena. D&D NEEEDS FLGSes. Even with D&D Beyond, even with the VTT, there's only so much that can be done via apps. The game thrives on sitting around a table together in person (or at least a private zoom call room with the group together).