Trappers, lurkers above, and various piercers can innately hide. Cave spiders and all snakes except water moccasins can hide under objects on the ground. Mimics can disguise as objects, which is related. All water creatures can hide in water.
Moving next to a monster so hidden grants them an opportunity to attack you unnoticed, and attempting to move onto the tile where they are produces "Wait! There's a foo hiding under <an item>!", wasting your movement time. This also goes for movement with the m command (sometimes except if you are warned of the creature).
If you know exactly where the hiding monster is and are already adjacent, you can simply use the F command to fight it. Otherwise, the monster will get a turn, and hence a chance to hit you, before you do. It is possible to hit hidden monsters with ranged weapons, making it fairly easy for wary players to detect them.
Searching or throwing objects is guaranteed to reveal their position. Searching causes them to stick to you if applicable. Gold is good to throw because it is abundant, does not risk breaking pacifist conduct, and gets you credit in stores.