Back in the day, they used to watch what happened to perishable goods, such as butter, and they found it interesting to see bugs coming out of it.
Hence, the idea of organisms being borne out of non-living objects came about.
Once microorganisms were identified by science, and the creation of the microscope allowed us to attest to their existence, society understood that what actually happens is that eggs are laid by bugs and it is from there where these replicate, not from the non-living objects.
The term "spontaneous generation" refers to the idea that people used to have about where things like mold came from. The idea of spontaneous generation was that certain things, like bread, could just spontaneously give life to mold and maggots and things like that.
This idea made sense back then because bread would be fine one day and all of sudden it would have mold on it. But when van Leeuwenhoek invented the microscope, this theory was no longer credible. With the microscope, it became possible to see bacteria cells and other microorganisms that are actually behind the growth of things like mold.
Until seventeenth century people believed in spontaneous generation or aboigenesis of living organisms from nonliving substances. According to Epicurus, an ancient Greece, worms, and numerous other animals were generated from the soil or manure by the action of moisture, and warmth of the sun and air.
According to Aristotle (384-322 B.C) living creatures are born from like species no doubt, but they also arise spontaneously. Thus common worms, bee, wasps, ticks, and various other insects are born from dew, rotten slime, manure, dry woods, sweat and meat etc.
Another word for spontaneous generation is Abiogenesis. It is the theory that all living thing generate from nonliving things. This was believed to be true up unto the time of the invention of the microscope when organisms could be studied at the microscopic level. Louis Pasteur finally settled the question in 1864 with his experiment having to do with microorganisms that carry dust particles. He was able to prove by boiling liquids that had dust particles. There was no contamination for days. But in one experiment he tipped the flask sideways and contaminated the liquid with the dust particles and discovered microorganisms in the flask. The following sites might help clarify some of this for you:
Theory of spontaneous generation, which has continued in parallel with creationist ideas of the last two millennia, is another old "explanation" of things that have long remained unexplained, because of insufficient development of science and technology.
Since antiquity, then along the entire Middle Ages and up to half of the nineteenth century, it was believed that some forms of life may occur "by itself", in certain circumstances. In particular, it was about the not really loved living creatures and about the conditions ... not too hygienic. Often, the conditions necessary for life to emerge ...as simple as that, were decomposing organic materials, the decay, dung and other garbage. However, the belief was widespread.
The first serious attack against the universal belief came from Francesco Redi, an Italian poet and enlightened physician . At that time (century XVII), everyone knew that in carrion naturally occurring "worms" (actually it was the larvae of flies). Somehow, Redi suspected that larvae came from eggs deposited by flies and wanted to prove that. So he took several pieces of meat, which put them in several pots, some sealed, others with mouths covered with a thin fabric, and others completely open. As expected, maggots appeared only in vessels where flies could enter to lay their eggs. Remarkable is that test by Redi can be considered a science experiment in the modern meaning of the phrase: executed in different variants, with the modification of experimental conditions, with lots of control ... everything. However, people continued to believe in spontaneous appearance of life and, apparently, Redi himself was convinced that the thing is possible, if not to flies, then to other living creatures and in other conditions. Which shows that, no matter how enlightened a man could be , is subjected to cultural conditionalities imposed by place and time in which he lives.
Invention of the microscope has done nothing to strengthen people's faith in theory of spontaneous generation.
In 1745, English Pastor John Needham said he would unquestionably demonstrate that the spontaneous generation theory is true.Subject matter experiment was meat broth - a very concentrated broth that is used today as a culture medium for bacteria, in research laboratories. After experiment, broth became turbid, the evidence that it had increased in microorganisms, a victory for gullibles of spontaneous generation theory.
In 1859, the French Academy of Science offered a prize for the best experiment to confirm or refute the spontaneous generation hypothesis.The winner was Louis Pasteur, with his famous swan-neck bottles. He made meat broth in glass flasks with long necks, then warmed the neck of each bottle and bent in the shape of S, without the seal. Finally, he boiled the broth. Air could enter the bottle, but microorganisms are deposited in the arc, down the throat, without get into the liquid. Broth remained clear, sterile. When researcher tilted the bottle, so the broth to get into contact with the concave side of the neck - where microorganisms were gathered - the liquid was contaminated, the bacteria have multiplied and the broth became cloudy. Winning brilliant!
Pasteur's experiment demonstrated the falsity of both spontaneous generation theory and the fact that microorganisms are everywhere - even in the air around us which is full of them.