A pandemic is an epidemic that spreads over a very large geographic area, typically several continents.
Many infectious diseases often spread rapidly through a population, but also die out very suddenly. For example, cholera epidemics are still fairly common, but tend to be geographically limited to a single city or it's surrounding area.
However, some diseases manage to allow many patients or vectors to survive long enough to travel. In most cases, an epidemic is often spread to a new population by a single infected patient who travels to the city. However, in a pandemic, multiple infected but asymptomatic individuals spread to several new populations. They often manage to infect persons who flee the epidemic, only to pass it on. For example, bubonic plague was spread both by rats and by people fleeing the plague who were asymptomatic but later developed symptoms. AIDS became pandemic despite the difficulty in transmitting it due to a single individual, an airline steward, who managed to infect dozens if not hundreds of others all over the world. The last great influenza pandemic partially spread due to the demobilization of soldiers from Europe back to the Americas and Africa.
At present, pandemics are becoming increasingly rare as overall health improves and many infectious diseases have a high rate of immunization. Influenza, for example, still kills thousands of people every year, but influenza epidemics that kill millions are often prevented by high vaccination rates in cities and other places where transmission is likely to occur.