It was originally used in ancient Greek city-states to refer to people who were overly concerned with their own self-interest and ignored the needs of the community. Declining to take part in public life, such as (semi-)democratic government of the polis (city state, e.g. Athenian democracy) was considered dishonorable. "Idiots" were seen as having bad judgment in public and political matters. Over time, the term "idiot" shifted away from its original connotation of selfishness and came to refer to individuals with overall bad judgment–individuals who are "stupid."
In Ptolemaic Egypt, idiotès was a term for soldier (etymologically parallel to that word which derives from sold 'pay'), derived from the idios logos, the Ptolemies' royal treasury that paid them.
In modern English usage, the terms "idiot" and "idiocy" describe an extreme folly or stupidity, its symptoms (foolish or stupid utterance or deed). In psychology, it is a historical term for the state or condition now called profound mental retardation.