suppose it turns out that the PCs are surprised. The reason
why they are surprised - eg they're looking the wrong way, or are distracted by sorting through their gear, or relieving themselves (Gygax identifies this as a possible cause of surprise in his DMG) - has already come about, in the fiction, at the time the die is rolled.
<snip>
The 2014 5e D&D rules for surprise are no different, as best I can tell.
From DnD Beyond,
Surprise
A band of adventurers sneaks up on a bandit camp, springing from the trees to attack them. A gelatinous cube glides down a dungeon passage, unnoticed by the adventurers until the cube engulfs one of them. In these situations, one side of the battle gains surprise over the other.
The DM determines who might be surprised. If neither side tries to be stealthy, they automatically notice each other. Otherwise, the DM compares the Dexterity (Stealth) checks of anyone hiding with the passive Wisdom (Perception) score of each creature on the opposing side. Any character or monster that doesn't notice a threat is surprised at the start of the encounter.
If you're surprised, you can't move or take an action on your first turn of the combat, and you can't take a reaction until that turn ends. A member of a group can be surprised even if the other members aren't.
Why do the adventurers fail to notice the gelatinous cube? At the table, *because their passive WIS (Perception) score tells us so. And then, if we like, we have to make up some retroactive reason, about what the PCs were doing immediately before this moment, that explains why they didn't notice the cube.