We have had this discussion a number of times recently and it usually boils down to a couple opposing viewpoints.
There are those that want their traps to make sense in the fiction, which has a whole lot of cascading consequences but usually lands on "traps should kill intruders and secure locations."
Then there are folks who think traps are there for the game more than the fiction. This usually leads to "make them.dynamic and complex and encounters in their own right."
The other "school" usually can be summed up as "traps are dumb and/or unfun and don't belong in the game."
In the end, the discussion usually ends up being a proxy argument about agency and fairness.
Well said! I think the realization from the OP is a good one.
I don't think it's a "one answer fits all sizes" thing though. There are multiple ways to use traps or reasons why a GM might use them. "Adding spice or variety besides combat" is something I often hear on the Discord servers, but that's only a very surface answer, so I'm going to share my approach...
Traps That Contain/Capture/Redirect – These are often hinted at early on through the whole concept of the dungeon, e.g. a shifting hedge maze or the laboratory of a mad wizard with tons of cages and glyphs binding monsters. But they tend to be less obvious in the moment because triggering them typically is not devastating & doesn't present a dead-end to the adventure, but rather changes how it proceeds from there. The more consequential these become, e.g. splitting the party across vast distances or forcing them down into a much deadlier part of the dungeon, the stronger and more recurrent the foreshadowing.
Traps That Kill / Severely Harm – These are the ones best served by the OP's realization to "make traps obvious." Another way to say this is to present the trap as an Obstacle. If the players decide to go this way, if they don't devise a way to circumvent the path, then they need to creatively resolve or devise countermeasures to the trap...and that may not be guaranteed success. So it's a risk vs. reward situation. This means that the reward
has to be worth it to the players. That's something that I see missing fairly often, but the reward can be a person held hostage, any kind of treasure, a new route that shortcuts dangerous/tedious/undesirable areas of the dungeon, a wishing well for blessings/charms/undoing curses/regaining wounded ability scores, gaining access to weaponize that traps or several traps against enemies in the dungeon, etc. As important as making the trap interesting and engaging to multiple PCs (not just the rogue) is making the reward desirable, interesting, creative, and at least somewhat clear/obvious (otherwise there's no lure).
Traps That Attack Resources – These are the "plinky" traps you'd see in many AD&D adventures that would deal damage to PCs with "gotcha" moments. Mostly they're uninteresting mechanically. However, the effectiveness of these traps is more interesting when they don't target Hit Points (or that's secondary to their main effect), but rather target something that's genuinely a resource in this dungeon (e.g. rations/water in a prolonged megadungeon; torches/light in a dungeon with waterfalls passages, monsters consuming magical light, tricks vs. darkvision, and so forth; exhaustion; time when faced with a time limit; spell slots either as a penalty or unique expenditure to bypass obstacles). If a "gotcha" trap is present that specifically targets Hit Points, it's important to think especially closely about narrative & presentation, and the AngryGM's "Click Rule" is especially important to implement (I've found it's often a good guideline with non-obvious traps, but especially these punishing kind). Another trick to making "gotcha" traps more interesting is having the trap reveal something after it triggers, like it opens a secret/concealed door, a boulder punches through a wall revealing a corpse you can
speak with dead on, etc.
Traps That Alarm – Alarming traps have a 50/50 chance of being non-obvious, but there's less onus to give immediate clues about the non-obvious ones as long as they're logical for the dungeon. Myconid or Zuggtmoy themed dungeon? Shriekers are right at home. Thieves Guild rigged against city watch incursion? Tripwires to alarm bells/gongs makes sense. Tower of a paranoid mage?
Alarm spells. These don't get used as much, but there are far fewer restrictions for their use to be interesting / players to get bought in, IME.
EDIT: A question I see regularly on Discord from newer GMs is "Running a X-themed dungeon. What's a trap I can put in this room?" There's usually no context given. The specific problem there is that traps exist in context even more so than monsters or treasures. While those things exist in context, traps need context to give the players meaningful information/clues/foreshadowing. Kobolds ambush you? Ok, Stealth v Perception. Treasure is cursed? OK, there's a bit of lore you can get that hints at that. Walls smush you in this area? The burden for clue-giving is higher on the GM / adventure.
The other problem with this sort of question is that it is blind to the distinction between the trap types I outlined. Not all traps do the same thing, and because of that they are best handled in different ways with different objectives.
EDIT EDIT: I'll add that if you're including a Poisoned Lock or Poisoned Chest, it's reaaaaallllly important to decide consciously what type of trap this is.