There is no simple answer to your question.
There are many reasons why some people get sick more often than others.
Factors that can influens the immune system are
- nutritional intake
Your immune system needs protein, minerals, vitamins etc. To function (fruit, vegetables and fish are beneficial)
- the number of infections that you have already had
Many infections generate immunity, so if you have had such an infection once, you will not have it again
- breastfeeding exclusively during the first half year of lift boosts the immune system
- genetic differences in the immune system can make some people more prone to infection than others.
- subclinical (unnoticable) infection
It could very well be that you have had the same infections as your friend, but that your immune system deals with them differently, so that you do not even notice that you came in contact with these infections
- the people in the slums whose immune system could not deal with the infections are probably dead by now
People who are under a lot of stress, have fewer disease-fighting white blood cells. When you are in a bad quarrel with a close friend it can make your white blood cells go down by 50%, leaving you with fewer disease- fighting abilities.
The exact differences in the immune systems of people are not all known yet. There are a number of known diseases of the immune system, but they often lead to severe disturbances. There are so many different molecules in the immune system, many of which with still unknown functions, that it is impossible to tell that in one answer.