One day the sun will expand and swallow up the Earth. Unless humans have successfully propagated throughout the galaxy, the death of the human species will mean the death of D&D. We must expand onto other planets in order to save our hobby!
On a more reasonable note, I doubt D&D is going to die any time soon. It's become such a brand that some form of D&D will still be played 50, 100 years from now. I mean, look at Monopoly. Whoever thought that game would still exist (even though it's no longer played as it was originally intended).
But if I'm speculating, here's how I could foresee the "death of D&D."
Due to some kind of financial maneuvering, Hasbro has to offload D&D to another company. This new company wants to turn D&D into a pure profit machine for as long as it can get away with it.
The new company does one of two things:
1) Pivots D&D to a 100% digital subscription-based platform, no longer supporting print books. D&D becomes more of a mobile app with very light rules. You get the basic game for free, and can subscribe for more resources, focusing more on character appearance, digital dice, etc. They bring in loot boxes, somehow.
2) D&D starts churning out a new products at an enormously fast pace. They start doing more tie-ins with other IP. Eventually when these products stop making money the company stops supporting the brand.
Do I think it likely that either scenario is going to happen? No. But I worked for a bit for a video game company that had a really great product that easily could have become a new Pokemon level of success, and it was driven into the ground by its parent company. It was really sad to see.