Social engagement circuitry in your brain is in other parts than dedicated internal conversation logic thought streams.
By talking to someone else, you're simply mobilizing a different set of circuitry and thinking approaches.
It's like you switched llm models
I don't think this is particularly a complicated phenomenon