In epidemiology, an infection is said to be endemic (from Greek en- in or within + demos people) in a population when that infection is maintained in the population without the need for external inputs. For example, chickenpox is endemic (steady state) in the UK, but malaria is not. Every year, there are a few cases of malaria acquired in the UK, but these do not lead to sustained transmission in the population due to the lack of a suitable vector (mosquitoes of the genus Anopheles).
For an infection to be endemic, each person who becomes infected with the disease must pass it on to exactly one other person (on average). Assuming a completely susceptible population, that means that the basic reproduction number (R0) of the infection must equal 1. In a population with some immune individuals, the basic reproduction number multiplied by the proportion of susceptible individuals in the population (S) must be 1. This takes account of the probability of each individual who the disease may be transmitted to actually being susceptible to it, effectively discounting the immune sector of the population.
For the disease to be in an endemic steady state:
In this way, the infection neither dies out nor does the number of infected people increase exponentially but the infection is said to be in an endemic steady state. An infection that starts as an epidemic will eventually either die out (with the possibility of it resurging in a theoretically predictable cyclical manner) or reach the endemic steady state, depending on a number of factors, including the virulence of the disease and its mode of transmission.
If a disease is in endemic steady state in a population, the relation above allows us to estimate the R0 (an important parameter) of a particular infection. This in turn can be fed into the mathematical model of an epidemic.
It should be noted that while it might be common to say that AIDS is "endemic" in Africa, this is a use of the word in its colloquial form (meaning found in an area). AIDS cases in Africa are still increasing, so the disease is not in an endemic steady state. It is more correct to call the spread of AIDS in Africa an epidemic.