Generalisation is the ability to perform a trained behaviour in a range of different situations, not just the one it was originally taught in. Dogs don't naturally generalise well. A dog who sits perfectly in the kitchen may act as though they've never heard the cue at all in a busy park.
This isn't the dog being stubborn or forgetful. From the dog's point of view, a cue given in a new location, with new smells, sounds, and distractions, can genuinely seem like a different situation altogether.