Richard Garfield/WotC invented Magic: the Gathering. It was a revolutionary game and it made a killing, which is where the money came from for WotC to buy the D&D IP in the first place. It was in bankruptcy due to the poor management of TSR. Hell, "Wizards of the Coast" is a reference to Garfield's D&D campaign back in the day. Hasbro then came along and swallowed WotC up for $325m or so.
Magic brings in about 80% of WotC's gross income, D&D about 20, maybe a bit more. OTOH, D&D brings in a much more substantial percentage of their actual profit, as much of it is electronic product now. You don't have to print, ship, or store inventory as a pdf. and the company owns it's own VTT which it is working to greatly improve as a game, better graphics, etc. OTOH, WotC's track record with electronics is pretty spotty, so I don't have huge confidence in that as a big moneymaker in the near term. Will provide good cash flow eventually probably.
Per the Motley Fool article linked above:
"It's hard to overestimate how important Wizards of the Coast is to Hasbro. According to data from
S&P Global Market Intelligence, it accounts for just 22% of Hasbro's annual revenue -- but produces a staggering 72% of Hasbro's profit."
Many/most of Hasbro's products are clashic games that are slow and steady sellers with a limited profit potential. You can sell a certain number of Monopoly games forever, but they will not spike due to a new release and if you jack the price up too far people will simply buy something else. The root of the problem here is that Hasbro seems determined to milk their cash cows dry for short term profits, at the cost of alienating their customer base. There are tons of other tabletop RPG systems to choose from, and if you Pish people off badly enough they'll make that move.
Add that their handling of this has been pretty poor. OTOH, they got stone busted and unexpectedly had their pants torn off and have been playing catch up ever since.
Their longer term strategy was to 1. introduce a new edition, which always drives sales because everyone needs the new DM's Guide and Player's Handbooks, 2. Write a new predatory OGL that either taxes third party content producers or drives them out of D&D, and 3. To make a concerted push over time to drive as many players as possible to D&D Beyond, the virtual tabletop they acquired that allows play over the internet. Tabletop play means that only the DM's purchase the vast majority of the books and modules they release, while D&D Beyond would let them extract money from the entire player base in multiple ways.
Another thorny problem for WotC is that many of their recent releases for D&D are of uneven to poor quality. The writing is halfashed, and many cases the new stuff they put out appears to have been minimally playtested (if at all). Often the third party providers release product that cleans up those messes - they provide rules clarifications or improved versions of official releases. I've seen a number of people on Reddit and elsewhere vowing to never again advance buy any product from Wizards because they have spent from $30-50 on stuff that was of little use. "They're not getting a dime of my money until it's out and I've either seen it or have read good reviews. I'm tired of buying expansions that are supposed to contain core product which are a waste of money." Pushing out the 3PP will only increase the pressure on them to release better products, and frankly, it's been a while since I've seen anything that makes me think this is a priority for them.