The city was able to maintain decent amounts of food and water, and therefore was an important pit stop for trade caravans traveling along the Red Sea. This was especially important given the merchant culture of Arabia. Along with the port of Jidda, Medina and Mecca thrived through years of pilgrimage.
When the body is given weakened/dead pathogenic material this helps build up an immune system towards the actual live infection. It prepares the body for the infection so that the person does not get sick.