D&D characters usually have nothing to lose but their lives.
They lose HP, yes, but if they don't die, they can usually recover most of it in a day (in old-school D&D requires a cleric for that, but they are still good to go in a day or two).
And HP loss doesn't mean anything except death. You do not get slower, weaker or poorer because you lost HP. As long as you don't die, you're good to go.
So either they lose NOTHING, or they lose EVERYTHING.
The stakes are ALWAYS at a maximum, with no room for maneuvering.
In most games, taking a hit means you have to DEAL WITH YOUR LOSSES, something D&D PCs rarely do.
Think of a game of chess; when you lose a piece, even a pawn, you're hindered for the rest of the game. What about a soccer match? A goal leaves you behind, but you can recover from that and even turn the tide in your favor.
Fighting is even more interesting: you win/lose rounds while also managing stamina, wounds, etc., AND you always have the chance of a sudden reversal of fortune, no matter how many rounds you already won or lost.
The system (kinda) works in DUNGEONS, since you have limited resources, limited time, and to restart you'd have to leave the dungeon.
But it doesn't seem to work in wilderness play, where there is only one encounter or two per day. Even if you're playing only dungeons, they become a bit boring if the only two results from delving deeper is a binary "get richer or die".
This has been a problem for me in practice.
How to fix it?
Let's consider some alternatives.
TIME - Unless there is some kind of ticking clock, players do not give enough importance to time. As noticed above, they can only lose a day or two. Maybe if we slow down everything - recovering spells, wounds, etc. - we'd have more meaningful consequences. E.g., "you can recover all your resources after a few weeks, but now it is winter...". I've noticed that even without a ticking clocks some players automatically give a week's rest more gravitas than a day's rest. Adding random events can also help things immensely.
LEVELS - A few monsters do this, but it has been widely criticized and largely abandoned. It could work for some monsters, but what would we do with the rest?
HIRELINGS - Not only can they hire more, but they can even save their salary if they perish. You'd need to make PCs care about NPCs, or at least limit the number of hirelings, force the PCs to provide some kind of insurance, etc.
NPCs - Maybe the PCs already care about other NPCs (family, allies, etc.). But it is unlikely that they travel with the PCs, and feels unfair to just kill them off-screen - unless there is a previously known ticking-clock attached to the event.
LIMBS/WOUNDS - Lasting wounds could make a difference. Healing them might require weeks or a quest. In some cases, the PC would just have to deal with an impairment forever.
GOLD - In my experience, PCs get rich soon, and accounting is just not that fun. I don't want to deal with taxes and fines in my games. That is boring enough in real life. At most, I might require a monthly upkeep for food and housing, but this unlikely to make a dent in the PC's finances. Maybe the PCs will buy/build castles, but they have to decide that for themselves - and if I burn those castles, they are unlikely to ever build new ones.
ITEMS - Monsters that destroy weapons, spoil magic items, etc., feel a bit forced, but could work. Even better, we could have magic items of limited uses more often, which would force some strategic thinking.
REPUTATION - I think this would be a good solution, but it requires some deep reflection/preparation on the wider world - or use some reputation MECHANIC (i.e., IIRC there are some in Pendragon, Oriental Adventures, etc.)
SANITY/STRESS/ETC. - You could have different mechanics to represent other kinds of losses. Call of Cthulhu has sanity - this is hard to recover. Darkest Dungeon has stress. Adding other gauges in addition to HP grants the game some tactical depth. Exhaustion from 5e is an interesting one, since it bypasses HP and has other consequences (affects speed, skills, etc.).
Come to think of it, exhaustion and stress could be a great solution to this "you get better in a day" problem. But that also deserve a post of its own.
DEATH - In some versions of D&D, death is nothing but a "lasting wound". If raise dead is widely available, death might represent a new goal or quest to save the dead PC (maybe with a ticking clock), a cost in gold, a few weeks of downtime (e.g., in B/X it takes at least two weeks to recover).
[Come to think of it, just considering 0 HP to be "grievous wounds" and replacing raise death for some kind of "cure grievous wounds spell", with a small chance of failure, could make the game significantly grittier and less magical without significantly altering the rules].
NOTHING - What if death is really off the table and the PCs really have nothing to lose? This seems to be a common trend in modern games. I can't quite see the point in a game with no real stakes. Of course, PC death is an issue to be dealt with - you can have raise dead (maybe at a cost), automatic resurrections a la Dark Souls (which also has a cost), on mere unconsciousness.
If even death is inconsequential, you probably need to find consequences elsewhere.
A proposal
I think I'd like my games to have multiple lasting stakes at the same time. Instead of just dead/alive or even zero to full HP, I want consequences to affect characters thought time.
As I've often insisted, spell shouldn't just renew everyday. Maybe some spells can only be performed once a year, or once in a lifetime, requiring the blood of a nearly-extinct beat.
A character could lose an eye, gain a few levels, so that he is a better fighter but a worse archer, and in any case much more powerful because of his new allies, while still threatened by stronger enemies.
This is the kind of games RPGs are supposed to be, IMO. Every decision can be relevant for ages to come.
There is victory and defeat, but trade-offs are much more common.
A conclusion (?)
RPGs are games. Game should have stakes, unless there is a reason to do otherwise. At the very least, be mindful and honest about these.
When creating adventures, running games, describing scenes, etc., consider the stakes.
In addition, let your players know the stakes.
Sometimes, they PCs will be surprised by a monster or trap they couldn't have anticipated. This should be RARE, and even then there will always be SOME choice involved - sure, they got surprised, lost initiative and were slain by a dragon before they could draw their swords, but they did wander into the haunted forest after all!
Most importantly, let them know what kind of game they are playing, from the beginning.
If you will fudge the die and the PCs can't die, let your players know beforehand (or right after it happens). If they need to be captured because you "planned" the next "scene", let them know. And if you want to ban, or introduce, fudging, maiming and death to your stories, talk to the players before you do.
Playing a game without knowing the stakes is just unfair for all involved.