Science and discovery is inspired by humans who want to better understand our universe and apply existing knowledge to find solutions to problems that affect our daily lives.
It is a very sad fact, but war and conflict have often been the biggest catalysts in improving things so humans can kill and destroy other human beings.
Flight is a very good example. When the First World War broke out, planes were used for observation purposes, to report on troop movements. The powered aeroplane was only invented about 10 years earlier. By the end of thee conflict, in 1918, planes were faster, more maneuverable and more resilient than ever before. They could also be used to shoot at other planes or ground targets and drop bombs. There is no doubt that the war contributed to that advancement and the state of air travel today.
The tank was another invention that was inspired by war. English engineers devised early tanks as a vehicle that could shield soldiers from bullets. It worked better than anyone could have imagined and led many automotive advances that were previously unimaginable.
Guns and rifles also tended to see many advances in times of war and even when the world was in a state of Cold War, space travel became a thing as the two superpowers of the USA and USSR flexed their muscles in a show of scientific force.
Science fiction also has a big effect on real science. Movie makers such as Stanleey Kubrick made predictions in films that have inspired modern scientists and inventors to come up with real tangible examples of artificial intelligence and developments to space travel that were unheard of. Concepts of hibernation and sub-space travel are also being studied by real scientists that have been inspired by the concepts put forward in science fiction movies.