In the late 90s I read a short story (probably written much earlier)
"Unwelcome Tenant" by Roger Dee, first published in Planet Stories, Summer 1950, available at the Internet Archive. If you read it in the '90s, it was probably in the anthology Fifty Short Science Fiction Tales edited by Isaac Asimov and Groff Conklin.
in which an astronaut on a mission to Mars
The feeling that he was a pioneer, an advance guard for a conquering people, elated him and multiplied the eagerness in him when he turned his eyes to the forward port where Mars hung, full and ruddy, a spotted enigmatic disc of promise.
is surprised to discover that he has spent his whole life with an invisible and undetectable entity controlling his mind.
He had been host to a parasitic intelligence, without knowing it, all his life. He had moved at Its dictates, following his own will only when It slept or tired or was distracted, never succeeding fully in any endeavor of his own because It was in control and must be obeyed. He knew when he had explored the vacated premises of his newly freed mind that It was only one of many, that all earthmen had Tenants like It, intangible parasitic entities subsisting upon and controlling the human life force.
The entity can only exist within a gravity well, so when he escapes Earth's gravity it releases control and falls back to Earth.
His first conclusion was inescapable: his Tenant had left him because It could not exist outside Earth's gravity. It had been forced to quit him or perish, and Its departure had made him the first truly free man.
The astronaut realizes that all humans on Earth are infected and controlled by these beings, who cloud men's minds and keep them embroiled in war and strife to keep humans down and maintain their control.
He thought: No wonder we have wars on Earth! We have no common ground for agreement because we are under Their compulsion. They know our inherent abilities and keep us at each others' throats lest we learn of and destroy them. Everything that man had accomplished has been done in spite of Them.
He plans to bring more humans out of Earth's gravity to Mars where they can live free, and eventually strike back and free Earth.
In a few hours he would land on Mars, and in a matter of minutes he would set up a beam transmitter to report back to the scientific foundation that had sent him out. He could not tell his fellows the truth because they were still captive, and their Tenants must not be warned; but he could invent a plausible story of easily acquired wealth on Mars that would bring other and larger commercial expeditions swarming after him. With the help of other freed men he could found a new civilization on the red planet, develop means to carry the fight back to Earth and exterminate the Tenants utterly. It would take time, but in the end men would be free.
Something impinged sharply upon his new perception, a chill groping tentacle of questioning intelligence. The smile froze on his face; he sat up stiffly, numbed with the unforeseen horror of what was happening to him. The groping ceased, and the hungry Intelligence from outside poured into his mind like smoke into an empty room, smothering his feeble attempt at resistance.
He rose and went to the forward port, staring dully down at the uprushing sandy wastes and trying to recall what glorious thing it was that he had been thinking. Or had it been only a dream? Somewhere in the farthest recess of his blunted consciousness a thought formed and floated like a bubble up into his awareness; but like a bubble it burst, and its meaning was lost on him.
There were Tenants on Earth, it said. Why not on Mars, too?