The immune system does not distinguish between natural infections and vaccines, forming an active response to both, so immunity induced via vaccination is similar to what would have occurred from contracting and recovering from the disease.