Immunity means exemption or resistance. If you're protected against something, you have immunity to it. Your new silver clothes just might grant you immunity from getting thrown in jail by the fashion police.
In the late 14th century, the noun immunity, which means “exempt from service or obligation,” developed from the Latin immunitatem, which has nearly identical meaning. Break that word down even further, and you get immunis, meaning “exempt, free,” from in "not" and munis, meaning “performing services.” In a medical sense, immunity is “protection from disease.” Your annual flu shot tries to give you immunity from, or make you insusceptible to, the illness.