Defense mechanism of vertebrates fall into two broad categories: innate and adaptive immune system, how many years ago and which evolution era they evolved?
the immune system is composed of cells and tissues that do not lend themselves to fossilization. Therefore it is impossible to trace the evolution of immunity from the paleontological record and the evolutionary history of the immune system has to be based on studying the immune system of living animals and genetics.
Genomic analysis of plants and animals suggests that a form of innate immune system was in existence by the time the ancestors of plants and animals diverged.
The adaptive, lymphocyte based, immune system in general is thought to be approximately 500 Million years old.
Calculations on evolution rates suggest that the AIS as we know it today (with more than one immunoglobulin molecule) took place 200 million years ago.
I highly recommend this review for details: Article Origin and evolution of the adaptive immune system: Genetic ...
See also: https://www.britannica.com/science/immune-system/Evolution-of-the-immune-system
the immune system is composed of cells and tissues that do not lend themselves to fossilization. Therefore it is impossible to trace the evolution of immunity from the paleontological record and the evolutionary history of the immune system has to be based on studying the immune system of living animals and genetics.
Genomic analysis of plants and animals suggests that a form of innate immune system was in existence by the time the ancestors of plants and animals diverged.
The adaptive, lymphocyte based, immune system in general is thought to be approximately 500 Million years old.
Calculations on evolution rates suggest that the AIS as we know it today (with more than one immunoglobulin molecule) took place 200 million years ago.
I highly recommend this review for details: Article Origin and evolution of the adaptive immune system: Genetic ...
See also: https://www.britannica.com/science/immune-system/Evolution-of-the-immune-system
Some defense mechanisms are also present in prokaryotic organisms such as bacteria. I think defense against invaders is probably a prerequisite for survival for all living organisms. Adaptive immunity (immunity developing after birth and upon contact with a pathogen and memory) appeared about 500 million years ago or roughly at the same time as the appearance of the jawed vertebrates.