If you do a search on the internet for "why do people talk to themselves," most of the answers you're going to get back are about schizophrenia or the fact that everyone does it "so you're not crazy."
But there's a third reason my 30 second haphazard Google search didn't unearth (though it might have; I didn't delve much further than halfway down the first page of results. You want science, look elsewhere, my friend. You should know this by now), and I think it's this:
People talk to themselves because they're (we're) attention whores.
That joke about it being the only way to be assured of having an intelligent conversation? Yes, and it's also a way of making sure that a room full of people who have their own thoughts and tasks are all totally aware of you and your every utterance.
Anyway, somebody said something out loud in their cubicle today (this happens many times, every day), in a tone that was intended to be overheard (everything this person does is intended to be overheard), and while I have to assume this person is as sane as I am (because doubting my own sanity would be a problem, and because I am not a doctor, and therefore completely unqualified to diagnose anyone; you should know this by now), it just struck me that it's possible this person (a former community theater actor) considers their position behind their desk, with their back to the window, facing the door of the office, as an actor, on a very small stage.
Yes, lady. We're all looking at you and listening to your performance. What you don't realize is that some of us are also judging your performance.
(This article cracked me up. Should I ever need to find a banana, I will be sure to say it out loud. "Where is the banana? WHERE IS THE BANANA? Seriously! Where's the goddamn banana!")