Going back a couple of hundred thousand years to unwind philosophy and science is an interesting thought experiment. Eating off the land, living off the land, and language, those came first. Language develops complexity with planning meals and shelter. Technology where we don't know how it works develops, mainly copying what the neighbor is doing to make life easier. Somewhere in there religion and philosophy started up. As philosophy warmed up, and technology became more complex, it became natural to watch, even ask how things besides life worked, which eventually grew into science. By then science was looking at all kinds of things and how they worked without an actual goal in mind, although knowing how something worked could easily be based on fiction. A possible origin of science fiction.