Fact 1: Active immunity results when an immune response to a pathogen produces memory cells. 
Fact 2: Pathogens are simply a variety of diseases which kill insects.
active immunity prevents insects from being killed.