If you take a creature completely by surprise, or vice-versa, there’s a short window of time when they cannot act due to the suddenness of your appearance. We call this the Surprise Round.
A Surprise Round only happens when a creature is unaware of any threats nearby, i.e. when all enemies about to engage the creature in combat are Unnoticed by them. (If they are aware of a threat, even if it is currently Undetected by them, they are sufficiently on-guard to not be taken by Surprise, though they are still Flat-Footed to any attacks from such threats.)
During a Surprise Round, the creatures who are being surprised immediately gain the Surprised condition, which lasts until the end of their first turn in the combat.
Example 1: The PCs are about to ambush a patrol of Oni. They make their Sneak checks to get into position, and Succeed at the Collective Skill Check, remaining Unnoticed by the Oni. Their Warlord lets out a shout, and they all charge in and loose spells and arrows, taking the Oni by surprise. The Oni have no idea that they’re there, and so gain the Surprised condition until they end their first turn of combat, making them Flat-Footed against the PCs’ attacks and unable to return fire or strike back for that crucial first few seconds of the combat.
Example 2: The PCs are trying to ambush a squad of soldiers guarding a gate into the Evil Overlord’s castle. They make their Sneak checks to get into position, but they Fail at the Collective Skill Check, causing them to become Undetected — the paladin’s full-plate armor lets out a faint clanking noise, alerting the guards that someone’s out there, but not quite giving away the party’s position. The PCs don’t wait to find out whether the guards will investigate, and charge in immediately. The fact that they’re not completely Unnoticed means that the guards are not Surprised — they may still be Flat-Footed against the first few attacks until the PCs stop being Undetected, but they were alerted to the possibility of danger and so are able to respond rapidly and take actions on their first turns.
Example 3: The PCs are sneaking through enemy territory when they come across a band of an opposing mercenary group engaged in combat with a squadron of Spartoi constructs, and decide to attack their old foes from behind while they’re busy fighting the monsters. They make their Sneak checks to flank the mercenaries, and Succeed at the Collective Skill Check, remaining Unnoticed by both mercenaries and Spartoi. On their leader’s signal, they all attack — but because the mercenaries are already engaged in combat, they are not Surprised, despite the PCs being Unnoticed. The mercenaries are still temporarily Flat-Footed against the party’s attacks due to them being Unnoticed, and are likely badly out of position, but they are already on guard and able to turn and respond to the attack in fairly quick order once they realize there’s a threat to their rear.
Example 4: The PCs are exploring a cave system and are ambushed by a pack of Troggs. The GM makes a Sneak check for the Troggs, and Succeeds against the highest of the party’s Perception DCs, meaning that the Troggs are Unnoticed by the PCs until they spring their ambush. Because the PCs (not the players; they might well expect the GM to pull an ambush at that point) didn’t notice the Troggs before they’re attacked, they are Surprised at the start of the combat encounter.