The epidemics and the pandemics are relatively new phenomenon in the human history. The reason for that is how the people lived, their ability to move in space, the communication between people.
In the past, most of the people had very restricted movement, and during their lives they only lived and were in touch with people in the same area. This was due to the inability to travel long distances, not knowing the world, but also because of restrictions by the rulers.
Gradually the world was changing, and lot of advancements were invented that enabled the people to move over longer distances in short period of time. That led to people from different parts of the world to be in touch, to share ideas, technology, goods, but also diseases. Every region in the world has problems with certain diseases, some of which are very infections. As the people started to be in touch with much larger masses of people from different parts of the world, they started bringing in diseases with them, causing pandemics and epidemics, some of which had terrible effects.