Vaccination helps the body develop protective antibodies against the hepatitis B virus. With 3 separate shots, a person can become immune to hepatitis B.