Some years back they rehabilitated the Statue of Liberty. No, she hadn't become an alcoholic, but the years and the elements had caused enough damage that extensive repairs became necessary. For a while the appearance of the statue changed dramatically.
In fact, you could hardly see the statue itself for the scaffolding that had been built up around it.
You need scaffolding whenever you're building something bigger than a bike shed whose walls your brother can prop up while you're nailing it together. Though there is a certain aesthetic appeal to the cathedral shrouded in scaffolding, it looks a lot better when it stands alone.
What has this to do with writing?
Some writers build worlds. It's a lot of fun. If you intend to design, say, a galactic civilization complete with competing empires rising to power and smashing together in war, you'll at least need a spreadsheet to keep straight all the birth dates and ages of the characters and how old they are when they found the Sirian Confederacy or abandon the Terran Empire. That spreadsheet is scaffolding. You the writer have to create and maintain this thing to keep things straight. And the amazing thing is that when you do this spreadsheet you'll see relationships and get ideas for stories you are not yet working on. This spreadsheet is scaffolding.
Likewise, it's embarrassing to discover that your strawberry-blonde supporting character with green eyes becomes blue-eyed a hundred pages later. To spare yourself this you may want to create a cheat sheet with all such characteristics safely tucked away in one place for quick reference and update. This cheat sheet is scaffolding.
Or let's suppose you've got a bit of backstory. Maybe the protagonist's and antagonist's fathers knew each other in the war. And maybe they exchanged some token. It's your story and your backstory. The reader needn't be bothered with the details. But you the writer must know all of them. The writer must understand why the backstory is as it is. In a case like this, I write a vignette of the elements of the backstory to work out the details. This vignette is scaffolding.
Maybe you're stuck at a point. You can passively wait for inspiration to strike you. Bad idea. Or you can write something related to, but off the arc of your story. By all means do so, you need to keep your writing muscles exercised. This puttering needn't go anywhere. You're just puttering until something breaks loose. This puttering is scaffolding.
Or maybe your story has a puzzle that the protagonist must work out. How did the murderer lock the door from the outside? You've got an idea, but you have to verify that it works. In my case, I got a chair and a door and a bit of string. It didn't work. So, I added a sheet of linoleum to make it work. (If I change linoleum to tin, it can leave telltale scratches your detective can detect.) Run the experiment with wife standing by in case something goes horribly wrong. This experiment is scaffolding.
Finally, there's that lovely map of Middle Earth with which you track your heroes movements. And estimate how many days journey lies between hither and yon. Scaffolding.
One thing about scaffolding is that although you may have a ball constructing it, you must tear it down and pack it away prior to publishing. Go ahead and do as much scaffolding as your world or your story or your scene requires. Scaffolding is not story.
And just because you don't sit down with the intention to write scaffolding, it doesn't mean you have not done so accidentally. One rookie mistake is to load your story down with unnecessary prose that does not contribute to the story arc. Usually, there's this preface or long expository passage in the front of the tale to "set the stage." Fooey. Dump it and start with your story's inciting incident while planning to dole out the fewest details only when needed. But it's pretty. Yes, dear, so is the scaffolding about the Statue of Liberty, but we have to put it away now.
No scaffolding should meet the public eye--with the exception of a map and a dramatis personæ.