The inmmune system is continuouly working in the human body. While no aggresive factore attacs the body the person feels no changes, however, when certain substances, germs or other factors enter the body the inmune system is activated. This happens when the body does not recognize those factores, which are called antigens.
When the inmune system is activated a number of proesses occur inside the human body. These processes generally allow the inmune system to identify the germ and learn how to fight it, so the next time the exact germ enters the body the inmune system will have information stored on how to fight it and the response will be faster.
Therefore, the first time a person encounters a certain disease he or she gets ill until the inmune system reacts and fights it. The next time the person encounters the same disease the person probably will not get sick.
The inmune system is beneficial because it allows the body to protect itself and save the information it needs to properly fight the disease in the future.
If the information on how to fight a specific germ is not available in the genetic material of the person then he or she, in orther to gain it, will eventually have to get ill or get vaccinated.