I think there is something to this question. Although Wizards-era DMGs are, in my view, extremely good at certain things, they are less good at addressing the question of where the Challenge in Challenge Rating really is, and certainly do not suggest the sort of "well, you strolled into the dragon's cave at first level, guess you all got eaten" play that was common in map-based play prior to 3e. To some degree that type of play is denigrated as balanced encounters are seen as the main type of encounters to be had. There is something to this observation. It doesn't come out of nowhere. Here is my response.
I. Retreat!
It's true the text of these editions is against the suggestion of characters stumbling into an unbalanced encounter due to bad or reckless decisions and getting eviscerated. But it should be noted that 3e is the first edition in which any attention at all is actually given to tactical movement. The only thing keeping monsters from simply walking past the fighter and killing the wizard in one hit prior to 3e was a sort of gentleman's agreement. 3e introduced the attack of opportunity, as well as other very specific defensive and offensive determinations related to movement. 4e did this even moreso, with many key action types and spells related to movement of the PCs and of the enemies. Wizards-era D&D is the first era of D&D to provide mechanical support for a retreat. So in practice, not in theory, these editions are actually okay with you getting in over your head in an unbalanced situation, because for the first time you can use the mechanics to your advantage in escaping the danger. (4e is the best at this because of its comprehensive tactical treatment of movement.)
II. Character Construction
In prior editions of D&D, the equipment and spell list was the key element of your characters capabilities past a certain level, and there were no rules for the sale, trade or obtaining of specific equipment or spells. Wizards-era D&D, however, involves multiple independent character creation choices at different stages of play. Magic items and equipment are more or less easily swappable with just a bit of player investment to become what you want them to be. (4e and 5e do this most effectively.) This means your character is a complex bundle of mechanics, and manipulating and adjusting that complex bundle is one of the key pleasures of the game. Then you depoloy them in a skirmish and see how they do. How do you contribute, how do you absorb enemy action, do you do a lot of damage, do you assist other PCs? All these are questions that 3-5e D&D puts to a character design, an intentional character design that the player has almost complete control over. (3e and Pathfinder are the best at this, Pathfinder 2e is probably the natural extension of this as it is more careful with the organization of its character capabilities.) Death isn't the outcome to be feared (necessarily, though it can happen it's less of a setback than in prior editions), but instead being ineffective across a swath of encounter types.
III. Social reasons.
This isn't just "well everyone plays D&D so it's easy to find a game." That's certainly true but I don't think this is what our interlocutor is getting at, nor what I think is important about D&D's setup to its social success.
First, D&D promises a casual experience. You don't have to remember clues in your typical D&D adventure. You barely have to remember names. The type of fantasy that D&D is is ubiquitous in video games and in modern fantasy novels. You have your swords, your elves and your wizards. They fight monsters. If you want a game where you can just kinda drop in and play and then not worry about the next time you get to play, D&D's great for that. (In fact many of the pre-Wizards play setups for club D&D were very similar.)
Second, D&D onboards its GMs in an exceptionally effective way. You need a GM to have a game of D&D, as well as many other RPGs, and D&D's dungeon setup is just ideal. You draw a map, you stock it with some monsters (pre-created encounters already available to you in the DMG!) and play. You don't have to worry about worldbuilding (or, indeed, the world at all). All you need to do is be able to say "the left hallway is dry and the right hallway is mossy and smells of mold." The pressure is off when you're a D&D GM.
Third, there's plenty of exceptional material out there so if you don't even feel up to that, you can get yourself an adventure or campaign and you'll be fine. In fact, there's lots of really heralded D&D campaign material out there to immerse yourself in - beautiful art, elaborate maps, lore to explore if you want, item cards for magic treasure, etc. People get excited about the new Adventure Path, and for good reason, you're going to get a really nice mini-campaign with high production values that's been well playtested (ahem, more or less). Independent of "well why don't you just play games that don't need all that stuff?" when you pick up Kingmaker (for example) and go "wow, we get to do adventuring AND establish our own wilderness kingdom?! that sounds fuckin cool! look, when we find a magic item we get a card with a high quality piece of art on it of the item" that is a pleasure in and of itself.
IV. Simple fantasy.
It's a little wild to see the encounter being addressed without situating it in an adventure or campaign. The adventure and campaign are both very present in the design of each encounter and each character. Even if the individual encounters are more or less going to go your way, you still do want to see the big evil guy defeated, or the mysterious magical disease cleansed, or the ghost ship to be sunk. It's easy to denigrate D&D as "well it's just imperialist murderhoboes obliterating innocent orcs on the Frontier; see Gary Gygax's comments on Native American genocide if you need the details." But the number of adventures that fit into this mold, even if we stretch it as far as we can, is pretty minimal when compared to the assumptions that characters will be protecting something. Low level characters defend farmers and villages; high level characters prevent planets from being torn apart by magical storms. You come back and you keep playing because you want Farmer Jones to not be killed by goblins and you want Toril to not be obliterated by a Red Wizard gone Mad With power. If an encounter - or dozens of encounters - go well, that's good, but in the context of an adventure or campaign, you may still be driven to want more! It's not complex, highly politicized fantasy or a complex mystery, it's simple, straightforward fantasy where the bad guy has to be found and put in your sights. And that's not a bad thing. For the reality of many player's real lives, this may be the level of investment they want or need. It actually sounds kinda nice while I'm describing it. Maybe it's time to go get into another D&D game...