I feel like "it depends on luck and choices!" is kind of a cop-out of an answer. Like, yes, of course, but luck is just statistics, so how many nat 1's or < 5's or < 10's need to happen to yeet a character from this mortal coil? And choices are just a question of genre - should the party be able to choose to single-handedly attack a well-defended fortress and expect to survive? What if it's a kobold warren? What if it's a giant steading? A dragon's hoard?
I have a different cop-out answer. ;-)
"Death." Does death mean drop to 0 hp? Does death mean fail 3 death saves and have to re-roll the character? What about resurrection - does it count as a "death" if it's something that can be reversed?
I think that for a "lethality is a real threat, but we also like to keep our characters" campaign, even with good choices, one party member should probably be dropping to 0 hp between each long rest (so maybe about 1/session). That's kind of a psychological definition - it helps a player "feel" like there's a real threat of death, because there's a dramatic state change (don't choose actions, roll death saves) and kind of a ticking time bomb. Even if a character can be easily brought back, the change in gameplay is typically enough to make them feel like something serious is happening. And it's OK if it just happens to one PC - the rest know death is on the table. That even making good choices isn't going to be enough to save you by itself (you still need the whole team, and you still need to be lucky).
But, at the same time, I think that actually losing a character should happen basically never. Not even 1/campaign. Still on the table, perhaps, if many things go wrong at the same time (I got swallowed by the purple worm and knocked unconscious and the party fled and couldn't recover my body), but it's not something that a player should ever really expect to happen to their character. Know there's a distant possibility of, yes, but never expect. And, again, it's a psychology thing - I want my players to be invested in their characters and the story and world they're in. That is harder to ramp up to if folks know their characters are disposable. Keeping the threat of the ultimate death in play stops players from treating this more like a story than a game, but basically keeping it at bay means that we can still enjoy the story in this game.
IMXP, when people talk about "difficulty," they're more talking about the former. And it's kind of a blend between character survivability and monster fragility (3 round encounters don't always feel "hard" to overcome in the way that a 10-round slog that goes back and forth can). I've never personally had much of a problem with difficulty in 5e. I run a Dark Souls inspired setting at the moment, and so getting the "this is a hard fight that could kill you if you're not skillful" vibe is something I try really hard to achieve, and achieve it pretty reliably with the Xanathar's encounter building rules. Damage is spikey enough that the party is actively choosing healing and defensive build options, because they're a little scared to go all-out with offense. This is chef's kiss. The reckless warrior or wasteful mage are not in genre, and would be pretty hard out in this game (though a clever party could make them work, I suppose).
Character death doesn't actually relate much to difficulty, I think. Character death tends to be more a genre choice. Where on the Storytelling <-> Gameplaying spectrum is your particular game? In stories, protagonists only die when there's a dang good reason. In games, death/failure is cheap and frequent and maybe kind of the fun. D&D 5e handles the middle of that spectrum pretty well, erring maybe a bit too hard on the Storytelling side. But it hits where I tend to prefer, which is a little more on the Storytelling side anyway. Not WITHOUT the game, just that the story gets to take the lead pretty often.