The Toffees narrowly escaped relegation after Frank Lampard took over in January.
"Frank came in, he inherited a broken squad. Mentally, we were broken," said Townsend, who is currently recovering from an anterior cruciate ligament injury sustained at former club Palace on 20 March.
"For some reason, we couldn't get out of that losing mentality, that losing run - we couldn't shake it.
"Now we've survived, the manager will admit himself it's the best thing that could have happened to us.
"He's seen which players he can trust, which players he can't, which players are mentally up for the battle. He knows what he needs going into the summer.
"Normally, when a new manager comes in, you get a bounce and we might have finished 10th and he wouldn't have really got to know the players.
"He knows exactly what we need now going into the summer. Hopefully we can use this experience of a relegation (battle) - first and foremost never be there again but use it as a springboard to go on next season."