Well, theres a couple of roles:
Traditional - Resource drain, barrier to entry or surprise, you tend to be inconvenienced, or whoever is killed by something they never get to react to. Dependent on the surprise factor, its boring, and rewards boring paranoiac behaviors. Funny enough they're also the most PC abuseable traps. And if someone was realistically trying to stop all comers with lethal force, this is the type they'd logically use.
Set-piece - The trap-as-encounter concept popular with Indiana Jones. The whole encounter is one big, elaborate, multi-part trap, which acts as basically a full ambush. Generally not easily avoidable or detected(or if detected, improbable to bypass), the environment entraps the characters inside the trap with its trigger, forcing them to deal with it(e.g. giant stone boulder appears behind you, leaving you with only one direction to go).
This type of trap needs to be dynamically disabled, your skills play a role in identifying what are the components that needs to stop, and your combat abilities to ensure you survive it, or damage enough of it to get through. In character wise, these traps are costly, and difficult to setup. They're also spectacularly hazardous, being difficult to bypass, so either they are to limited access areas(where nobody who can't deal with it is supposed to be in the first place) or they need to be armed(classic example is the fleeing BBEG arming his collapsing palace).
Very entertaining, done right, though you need to make clear first, the rogue would be making it easier to deal with(its much easier if you know where in the mechanisms to strike for to disable it, but as any security system designer would tell you, you wouldn't put these vulnerable spots where they are EASY to reach, so you must still face the trap), but not stop it entirely with one roll.
Battlefield control - The opposite of the above, you have NPCs that have trouble standing up to PCs? And you can't just improve their equipment, because the gear would spectacularly inflate PC wealth. So you give them a set piece encounter to fight in. Sure a pit trap is merely inconvenient. A pit trap which has a tribe of goblins waiting to take advantage while half the party is in the pit is worse, it'd give even a CoDzilla party some headache. PCs avoiding pressure plates by flying? Have pressure plate triggered AoE effects or barriers, which the monsters know where the mechanism will hit(hint, don't go for the guy who triggered it), so they basically just need to move to certain spots to effectively cast BFC effects.
Traps as puzzles - Loved AND detested, the trap is a logic puzzle to the PLAYER(not the PC), problematic in that you need to engineer through the GM's logic(especially if he decides to be 'clever' and do some russian reversal), with what clues your skills provide. This one is author and audience dependent. Also an old school favorite.
Undesirable outcome - The trap doesn't harm YOU, it sets off alarms, alters terrain in a travel scale, starts the end of the world sequence...you know. What it does is change things at a plot level. Its a simple matter to have alarm alert whatever forces are in the area to arm and investigate, as well as lock doors and reposition corridors. You can also have traps that alter travel options(avalanche is a classic, you need to detect it, and then you need to bypass it with silence...or the next stretch of your travel is now a wall of snow), etc. Quite entertaining, though the rules don't always say you can do things like that.
In all cases, triggers do need to be elaborated. Trip wires, sound, time(every X minutes, you must perform some action like stepping on specific sequence of pressure plates so they don't trigger), etc are all valid, not just the archetypical floor pressure plate. Even levers and switches, for giving enemies without spellcasting battlefield control.