Midichlorians may be one of the most hated aspects of the Star Wars prequels, but they were a part of George Lucas' mythology from 1977. Lucas' Star Wars Episodes I-III received a fan backlash that makes the reaction to Disney's handling of the franchise seem positively calm, and while a lot of reasons were cited - from contrived connecting of events to flat-out bad writing - one rallying point for the entire ordeal was midichlorians.
Whereas the Force had been an entirely mystical energy in the original trilogy, Star Wars Episode I: The Phantom Menace attempted to quantify it slightly by explaining how some beings were able to manipulate it and others not. Midichlorians were the result, microscopic life forms that exist within all living beings and allow the hosts to commune with the Force; the higher a person's midichlorian count, the stronger their potential in the Force. Giving a number to a person's Force skill and explaining away some of the mystique in how sci-fi magic worked, these were viewed as everything wrong about the lore alterations Lucas made to Star Wars.
However, the exact idea of midichlorians is so baked into Star Wars it pre-dates the fundamental notion of Darth Vader being Luke Skywalker's father. In 1977, following the unexpected success of the original Star Wars, George Lucas set about laying down the groundwork for his new expanded universe. He did this with a series of in-universe character accounts that explained everything from the rise of the Empire to C-3PO's origins that bear a striking resemblance to the prequel story (these are available today in J.W. Rinzler's exhausting The Making of Star Wars). The most striking of these is a section explaining the mythology of the Force, including a clarification on what it is to be "strong" in the energy that used the science of midichlorians:
"It is said that certain creatures are born with a higher awareness of the Force than humans. Their brains are different; they have more midi-chlorians in their cells."
While it isn't quite as detailed an explanation as The Phantom Menace, the basic idea - that midichlorians exist in cells, are essential to a being's communication with the Force and a higher count means stronger connection - are laid down here. This will surely have been in Lucas' mind while developing The Empire Strikes Back and Return of the Jedi, and quite possibly in the approval of expanded universe material.
That midichlorians were a part of Star Wars from the very beginning makes their introduction in The Phantom Menace feel a lot less sudden, although given how clearly they're explained also makes it surprising they were ever so controversial. Saying someone was "strong in the Force", as was common in the original trilogy, already implied that they were somehow innately more powerful; it was clear that the Skywalker lineage had greater Force power, just as it was that Han would never train as a Jedi long before there was a numerical measurement.
Even though they were a key part of Star Wars, midichlorians were barely mentioned after The Phantom Menace; they only got a throwaway mention in Revenge of the Sith during the Tragedy of Darth Plagueis, with not a single allusion in Disney's Star Wars movies. It's unclear if Lucas intended midichlorians to play a bigger part in Anakin's fall and adjusted plans following the fan unrest, but he definitely wanted to explore their relationship to the Force further; what little is known about his sequel trilogy plans suggests "creatures that feed on the Force", possibly those he teased in that short text description.
Midichlorians are far from the only element of the Star Wars prequels that Lucas had decided upon in 1977. Many key points, from Palpatine becoming Emperor by manipulating trade route to C-3PO being "totally reassembled by a young boy working for a junk dealer", are right there in the creator's notes. So, as controversial as Episodes I-III may have been, nobody can accuse George Lucas to not sticking to his Star Wars gameplan.