Spells Typically Require Investigation Check
The illusion spells clearly state that an investigation roll has to take place, so they all see the illusion unless or unitl someone says they want to search the passage for anything amiss or search traps. Passive isn't good enough for spells like Major Illusion, and they have to specifically call out using the action ("I'd like to see if there are traps or something is a miss in this passage.") to make a check roll.
A creature that uses its action to examine the image can determine
that it is an illusion with a successful intelligence
(Investigation) check against your spell save DC.
Traps May Be Found Passively
Other traps may be found with passive perception. You typically shouldn't call for a perception or investigation check unless the player DO something actively to cause the roll. Some DMs do, but this isn't what the rules say to do.
Getting Information to the Player
If a player does investigate and you want to keep the results secret from the other players, you can whisper in the players ear or hand them an index card with what they find out. If you really want it to be a secret and are using cards and whispers you also have to use them to say they see nothing out the ordinary.
If it is a basic trap, and you trust your players not to meta game, saying it in the open is fine. I've done both, as long as the players know the characters don't know the information until the player who say it says something. Reading Gregs answer before this edit and really thinking about it again, I may be preparing less cards in the future.
What I do (and where I might put trap)
Personally, I try to keep everyone in initiative order through areas with traps. To make this not quite so obvious, I try to place traps after areas where I anticipate combat, and I try/hope that a monster can flee through the corridor where the traps are hidden. The thought being they will think I'm keeping them in rounds because of the monster, so see if they can catch it or not. In order for this to work, I try to keep them in rounds anytime a monster escapes anyway -- if they catch the monster, battled continues and we don't have to re-roll init.
Of course, if everything is dead, I don't keep rounds going as that would be a tip-off.
If a player asks to investigate, I hand them a card (or more likely whisper something to them, because I only have so much prep time and can't make cards for everything. I like whispering "It looks like a hallway" when it is clear or they fail the check -- the other players then thing the player knows about a trap, when they don't). But even if you just tell them in the open, the other player's characters still don't know, so rest would still apply.
I also not let anyone say more than 6 seconds of dialog per round (not very strictly -- but if someone tries to explain a complex thing and it is taking too much time)... All of this it can on occasion create a situation where the player who knows starts to say, "Don't it's a ..." and then the player falls for the trap anyway.
I also place traps at places where naturally whoever built the dungeon/temple/castle/etc. might place them to protect something. These I don't expect to actually cause problems for the player, but instead the players would begin wondering why there is no security around this valuable artifact... Sometimes, however, even these catch players off gaurd, and be a source of fun/drama.
On using Traps Sparingly
Remember to use traps sparingly, so that the party doesn't begin searching every room they ever walk into for traps.
DM: You're in a tavern, the bar keep is a...
Player: I search for traps and hidden passages.
DM: The bar keeper says, "Why are trying to look under every table? Ya see a rat or something?"
Player: I insight check the bar keep.
DM: The bar keeper says, "Why are you looking at me so intensely? Are you alright? I think you've had enough, and I haven't even served you yet."