The MMR vaccine contains live attenuated viruses that stimulate the immune system to produce antibodies without causing the actual diseases. By introducing these weakened viruses, the immune system is trained to recognize and combat the actual pathogens if exposed in the future, thereby conferring immunity.