Writers ponder many things when they write, some of it related to what they are writing, a lot about completely different things that just randomly pop in and out of their heads, seemingly at will.
It can be difficult staying focussed as a writer and sometimes it means that they pour out or bleed into the page (or in this day an age the screen) anything and everything. Sometimes a writer will either subconsciously or consciously manipulate their writing and “go off on one” and in the book have a right good rant about something. Something that they felt passionately about but should it be there? is it in context to the story, characters and plot? Most of the time I would say not. It doesn’t serve the writing and should be cut out.
The writer can use far more subtle ways to express that rant in their writing that will make it zing rather than spoil the writing for the reader.
One of the other problems writers face is finding that balance between too much information to allow the reader to feel, sense and imagine the work and being to descriptive, putting too much in. I can say that from my point of view, practice and keeping to a writing discipline is a big help and I know because “I can feel” my writing getting better the more I write.
This off course means that I have a huge task going back over previous books and being brutal in the editing and reviewing for style, content and so on, but it has to be done and it is a challenge both my beta readers and I welcome.
Deep down if you find a writer in the right mood, you may just get that truth out of them because they will know when they need to revisit and cut. Just be gentle with them and don’t remind them to much about their confessions. Writers are after all sensitive nervous wrecks.
It is an occupational hazard.
This is a difficult one. Surely it is wise to stay focussed when writing a story or your reader is going to wonder what he has tumbled across.