An ambush is a surprise attack in which the attackers lie hidden, waiting for the unsuspecting target to arrive. Popular ambush spots are canyons, small rooms and forests. A good ambush is all about timing and the element of surprise - ideally, the trap should be sprung while the target is off their guard and far from any escape routes.
In games, when the player is ambushed they may have to defeat all the enemies before being able to move on - this is a very common scripted event, especially in shooters. Enemies can also ambush the player in turn-based games, usually giving the enemies a free turn at the start of the battle.
Generally, players are interested in moving forward to find enemies, not waiting around for enemies to find them. But sometimes players do get to conduct their own ambush, either spontaneously or as part of the game's story. The player-devised ambush is most common in multiplayer and open-world games, and is not to be confused with camping, a similar but less glamorous strategy.