Origin

Late Middle English (in the sense 'free from (a liability')): from Latinimmunis 'exempt from public service or charge', from in- 'not' + munis 'ready for service'. Senses relating to physiological resistance date from the late 19th century.

Latin immunis ‘exempt from public service’ (literally ‘not ready for service’) is the source of immune and immunity. The early sense of immune was ‘free from (a liability)’ and this general meaning was common from the 15th to 17th centuries. The sense ‘able to resist infection’ dates from the late 19th century.