Why does injection of tuberculosis bacteria cases immunity and not cause the disease?
Because the bacteria they inject you with is technically dead. Your bodies immune system identifies the bacteria as bad and makes antibodies that get rid of it, so the next time it encounters the same bacteria it knows what antibodies to produce. Each human disease has a specific antibody to combat it.