*Disclaimer* I am in no way promoting war. War is a terrible thing, perhaps the worst of human nature. Even now as I write this article there are millions around the world suffering as a result of conflict. The content of this article is in no way condoning that, the few benefits of war (I'll go into them later) in no form outweigh the loss of life.
Now that's out the way, let's discuss the effect that warfare can have on technological advancement. War can and has throughout human history led to leaps in technology, perhaps the only silver lining.
One of the most well-known examples of the direct impact Warfare on Engineering is the "Space Race." After World War II tensions between Russia and the US soared, in what's referred to as the Cold War, on the brink of all-out war both sides were determined to achieve a military advantage (I know this technically wasn't a war but it highlights how even the threat of war can influence human advancement) and this resulted in heavy investments from both sides in space exploration technologies, believing that adding space and even the moon to their military stronghold portfolios would be the perfect way to achieve this. In 1969 Apollo 11 landed Buzz Aldrin and Neil Armstrong on the moon, an astonishing feat for the time period. Almost certainly as a direct result of the cold war. So looking back now one of, if not the, biggest technological feat in human history came about as a show of force and the US puffing their chests out. (Some things never change.)
During the World Wars, many advancements were made by all sides, particularly in communications, transport, and even medicine. A lot of the early cars came about due to military development, before World War II there was almost a monopoly in the car industry with only the richest of society being able to afford a car it was a small market that led many investors to avoid it, because of this the choice of cars was very limited. The lack of competition meant that there was little need for car manufacturers to invest in and develop newer better models, either the consumer settled for what was there or didn't have a car. However, these same manufacturers were employed during wartime to design and produce better quality cars that would reliably transport troops, designs that eventually become available to the civilian population.
This goes some way into showing what a double-edged sword science and engineering can be. What I mean is the good and bad sides of engineering often come about as a result of each other. The same research and development that goes in to producing sustainable and clean energy in the form of nuclear energy can be weaponised to produce devices capable of wiping out life on earth, on the other end of the scale communications systems developed for war zone interactions have been developed and now allow us to speak to people on the other side of the globe giving friends and families a new sense of closeness that they would never have gotten with an old-fashioned letter. Even with airplanes, we can get from what point on Earth to almost any other in less than a day; do you think we would have the same level of air travel today if the same technology had not been used drop bombs on cities and civilians during the many wars humankind has endured?
It's an interesting, perhaps sad, fact that as soon as a product is shown to have a potential military impact, a lot more money seems to become available to develop it.
A History of the World in 100 Weapons
Interesting short read for anyone who wants to find out more about Military Engineering!