Moore's law was never a law, and it never said 18 months.
In 1965 Gordon Moore predicted that the number of components on a chip would double every year. In 1975 he revised it to every two years. The famous 18 months came from a colleague talking about performance. The prediction held for decades, partly because the whole industry treated it as a target.
Gordon Moore, then head of research at Fairchild Semiconductor and later co-founder of Intel, was asked in 1965 to predict the next ten years for an anniversary issue of Electronics magazine. His short article observed that the number of components on an integrated circuit had been doubling every year, and he guessed this would continue for at least a decade. Years later he called it a wild extrapolation. In 1975 he revised the pace to a doubling roughly every two years.
The Caltech professor Carver Mead soon christened it Moore's law, but it is an observation about engineering and economics, not a law of nature. The frequently quoted figure of 18 months comes from Intel executive David House, who noted in 1975 that the doubling of transistors, combined with other gains, implied chip performance would double about every 18 months.
The trend held remarkably well, and one reason is that it became self-fulfilling. Chipmakers used it to plan research and set targets, and competitors raced to keep up. Moore himself joked that his law was a violation of Murphy's law: everything gets better and better. The largest chips now carry tens of billions of transistors.
But the free lunch has thinned. A related trend, Dennard scaling, which let smaller transistors use proportionally less power, broke down in the mid-2000s, so more transistors no longer brought matching speed gains. Industry figures say progress has slowed since around 2010, and the cost of the factories needed to keep shrinking chips keeps rising. In 2005 Moore said it could not continue forever, since transistors were approaching the size of atoms. Experts still disagree about exactly when, or whether, it has ended.
Source: Wikipedia — Moore's law · Text summarised from Wikipedia (CC BY-SA 4.0)