mrpopstar
Sparkly Dude
In combat, most creatures stay alert for signs of danger all around.My position is that if you duck behind a barrel and make a successful stealth check, the creature doesn't know you're behind the barrel. You could make the stealth check first, if that would make it easier to conceptualize.
If you're in combat with a creature and you're in a fairly plain room with just one barrel (as in the scenario proposed by @Ancalagon), you can duck behind the barrel, but the creature is clearly aware that you're behind the barrel.
If you successfully "hide," you can get the jump on them with your next attack; not because you've escaped their knowledge of you being behind the barrel, but because you've escaped their readiness to anticipate your next move.
That's a fair-minded interpretation of the rules. A more conservative (though no less reasonable) interpretation would be that circumstances are inappropriate for hiding because the creature knows exactly where you are.