According to (outdated) psychological definitions, a moron has an IQ less than 25, an imbecile has an IQ between 26-50, and a moron has an IQ between 51-70.
Before idiot, imbecile, and moron fell into their current usage, they were highly specific psychological terms used to classify the developmentally disabled. Nowadays we prefer to use more respectful terminology, but in the past, people had used all kinds of offensive terms for those with mental disabilities.
Psychologists used to be obsessed with IQ. They often used it as the only measurement for cognitive development and ability, which is why it was used to classify idiots, morons, and imbeciles.
In the early 20th century, these words were much more commonly used in their psychological sense than as insults for people that are considered stupid (except for idiot, which has been an insult for a few centuries). By the 1970s, enough people used these terms as synonyms of stupid person that the technical classifications had to change.
The moron/imbecile/idiot classification remained popular, amazingly, until the early 1970s, when people started to note that the developmentally disabled have enough difficulties without being saddled with condescending labels. The 70s saw the move away from institutionalizing the developmentally disabled, and it has since been shown that the majority of people with IQs below 70 can lead productive and independent lives.
Psychologists initially replaced these words with mild, moderate, and severe retardation. However, those have also become offensive over time and were replaced with more appropriate terms in most discussions.
Usage over time
The chart below comes from Google Ngram Viewer, and shows how the usage of each word has changed over the past 320 years.
The word idiot has been around for the longest time, dating back as far as the 14th century. Imbecile is more recent, but it was originally only used as an adjective. Moron is the most recent since it wasn’t coined until its use as a psychological classification.