In the books Stannis is screaming treason for Davo's freeing edric storm. Mel wants him for his king's blood to awaken the "dragons from the stone" since stannis just got news that the 3rd named king from the leeches has died (Joffrey). Davos retorts with a letter he'd received by a raven. That chapter is about 3/4 through the book. The Davos chapter previous to that (about 2/3 through the book) you learned that it was the letter from the Night's Watch which Aemon sent to all 5 kings pleading for help, that Lord Mormont was dead and mance rayder was leading a vast host to attack the wall. Davo's says "only a starving man would beg bread from a beggar" which is when he realizes how urgent their cause is.
The next we see Stannis is when his Calvary is riding to the rescue at the wall, so it's somewhat of a wtf surprise moment. Not quite as big as the Littlefinger or LS reveal but a wtf moment nonetheless.
In the show the same scene plays out earlier this season but they explain it in detail, and Melisandre flat out stats that stannis must travel north to the wall because that is where the true battle must be fought, completely spoiling any surprise element. There's a few more scenes of Stannis and co, mel and his wife, etc. They obviously traveled north to Braavos where we last saw them, which is like directly across the narrow sea from Eastwatch by the Sea which is where they landed in the books.
Of course TV show viewers are likely to have forgotten all of this which happened this season, and it's unlikely they've looked at the map and know where stannis was last seen. But there is no foreshadowing needed, they flat out stated Stannis is headed to the Wall.