This is definitely Harry Harrison's Deathworld trilogy (1960-1968), released as a single volume The Deathworld Trilogy (1974).
Relating to your points:
- The planet is "Pyrrus" (hinting at "Pyrrhic victory") and the colony are miners;
- They have retreated over generations of continuous attacks to a single fortified city;
- The wildlife evolves very quickly to become ever more deadly. Creatures with claws also have venom; trees grow hollow roots to tunnel into the city to unleash attacks;
- The person who discovers this is the protagonist, Jason dinAlt, originally hired to use his psychic powers to cheat at a casino to get the money to buy weapons, who goes to the planet out of desperation with the casino after him.
Quoting from the summary on Wikipedia:
Everything on the planet is deadly to humans. The large animals are strong enough to destroy small vehicles, while the small ones have neurotoxic venom. Even the plants are deadly. All microorganisms consume insufficiently protected tissue as quickly as acids. On top of all this, life evolves so quickly that even Kerk and his Pyrran crew have to be retrained upon their return in order to survive.
Because of this harsh environment, the settlers are engaged in a ceaseless struggle to survive, which—despite generations of acclimation and a training regime harsher than that of ancient Spartans—they are losing. The money Jason won is used to buy desperately needed weapons.
While acclimating to the harsh planet, Jason turns his attentions toward solving the planet's mysteries and saving the faltering colony. The few surviving historical records Jason finds show that the settlers numbers have decreased since the planet was first colonized, and they are now restricted to a single settlement. Extrapolating backward, it is clear to Jason that the flora and fauna were once far less hostile to humans. Jason also learns of greatly despised "grubbers", humans living outside the city, with whom the Pyrrans grudgingly trade hardware for increasingly necessary food.
While studying the grubber community, he notices an anomaly—though the life-forms throughout the area are dangerous, they are nowhere near as lethal as the ones around the city. Some grubbers theorize that the initial schism was a disagreement over the city's location, in which the ancestors of the grubbers abandoned the dangerous ground in favor of their current homes. Jason has the grubbers guide him back to the city, so he can see it from the outside. There his psionic senses confirm his hypothesis. Every species of native flora and fauna is psionic, and all life around the city is telepathically "shouting" the same thing: KILL THE ENEMY! Pyrrus' biosphere is intentionally attacking the city.