See the breakdown of the bicameral mind.[0] What people now call the 'voice in their head' they used to think it was God speaking to them.
It's probably caused by parasites though [1]
The good news is with regular (real) meditation you can remove the voice entirely.
[0] https://en.wikipedia.org/wiki/The_Origin_of_Consciousness_in...
[1] https://www.livescience.com/61627-ancient-virus-brain.html