There are many that have dealt with this question and I will just summarize what some of them have said. Firstly, let’s put theoretical science aside, since such theories are constantly changing, and we therefore have no need to dispute or refute them. Chances are that they will not last for long. Also, certain supposed theories are not based on solid evidence and often can be classified as pseudo-science and not true science at all. In this short essay we’ll deal with topics such as spontaneous generation or other scientific evidence that has clearly been proven to be true. For example, it has clearly been shown that lice come from eggs and not through spontaneous generation. Spontaneous generation has clearly been disproved. How do we explain the contradiction between what we know today to be the truth and what Chazal have said?
One view that some take is that our chachomim did not have personal knowledge of certain things and therefore had to rely on the people of their generation for the facts. If the people told them that lice did not come from eggs because in those days they were too small to be seen, then they based their halachic opinion on the facts they were given by others as a rav usually does and not on the Torah itself. If people said that they personally saw a mouse being created from earth, they accepted the fact as being true and ruled as to what the halacha would be if these facts were true. While their decision was based on Torah reasoning and logic, the facts they were given were not always based on Torah but were provided by others. It’s like a bais din that relies on the information provided to it by two witnesses to render a decision. If the two witnesses are later proven wrong, one cannot blame the fault on bais din.
This may explain why we find that the chachomim changed their opinion and agreed to the secular theory stating that the earth goes around the sun rather than the sun going around the earth. Had the chachomim based their opinion on the Torah, they never would have changed their mind no matter how solid the proof. ( See Pesochim )
If we accept this explanation, then nowadays when we know the true facts, the law should change. In fact, Rav Eliashiv and others are of the opinion that today one should be stringent and not kill lice on Shabbos.
However, there are others who say that the actual Halacha was based on a mesorah and the reason given in the Gemora for the mesorah may not actually be the only one they had. There may have been another reason why it was permitted to kill lice. Actually, the Yerushalmi does give us a different reason for it. Therefore, even though we now know that lice are hatched from eggs the halacha does not change.
In areas where the Torah clearly contradicts science such as how creation came into being, then we need not even try to conciliate the two views since Torah represents the eternal truth and it is clear that all the scientific proof in the world cannot alter even one word of the Torah. Therefore, theories such as the one expounded by Darwin and others, that man came from monkeys don’t even need a refutation to a believing Jew. If one wants to refute the theory in order to convince scientists or non-believers that they are wrong, then they may try to do so. However, it is completely unnecessary for a believing Jew to try to develop theories in order to explain the contradiction. One must have full confidence that the Creator of the world knows best and it is the scientists who have to review their theories or proofs.
One must also beware that there are certain subjects that are off limits for us and that the Torah specifically doesn’t permit us to ask any questions concerning them. This refers to questions such as “What is above or what is below; what was before and what is after.” Some things are beyond human comprehension. Therefore, science that deals with such questions remains off limits to us.
משנה מסכת חגיגה )ב א, כָּל הַמִּסְתַּכֵּל בְּאַרְבָּעָה דְּבָרִים, רָאוּי לוֹ כְּאִלּוּ לֹא בָּא לָעוֹלָם, מַה לְּמַעְלָה, מַה לְּמַטָּה, מַה לְּפָנִים, וּמַה לְּאָחוֹר. וְכָל שֶׁלֹּא חָס עַל כְּבוֹד קוֹנוֹ, רָאוּי לוֹ שֶׁלֹּא בָּא לָעוֹלָם:
רע”ב דאמר קרא דברים )ד לב) כִּי שְׁאַל נָא לְיָמִים רִאשֹׁנִים אֲשֶׁר הָיוּ לְפָנֶיךָ לְמִן הַיּוֹם אֲשֶׁר בָּרָא אֱלֹקים אָדָם עַל הָאָרֶץ וּלְמִקְצֵה הַשָּׁמַיִם וְעַד קְצֵה הַשָּׁמָיִם הֲנִהְיָה כַּדָּבָר הַגָּדוֹל הַזֶּה אוֹ הֲנִשְׁמַע כָּמֹהוּ: