Natural infection can indeed lead to immunity, but it often entails significant risks, including severe illness and death. Vaccination offers a safer route to immunity by exposing the immune system to a controlled amount of the virus or bacteria, thereby minimizing risks while still providing protection.