Nature abounds with wonders — and the quest to explain them has driven some epic human advances.

But scientific discoveries are often resisted when they contradict powerful religious traditions.

Galileo famously argued in the early 17th century that the Earth was not the centre of the universe, and was instead moving at great speed around the Sun.

As a result, the Roman Catholic Inquisition banned Galileo's books and sentenced him to house arrest until his death.

In the 21st century, one natural wonder that has attracted controversy is the tiny rotating wheel that powers the swimming movement of bacteria.

Followers of a modern form of creationism known as "intelligent design" argue that this motor is too complex, too incredible, and too efficient to have possibly arisen naturally.

The awe-inspiring bacterial flagellar motor

Space to play or pause, M to mute, left and right arrows to seek, up and down arrows for volume. Watch Duration: 1 minute 20 seconds 1 m 20 s The 'incredible' flagellar motor looks like a tail on the bacteria (Credit: Prof Keiichi Namba, Osaka University)

The bacterial flagellar motor moves bacteria to places where the environment suits them better.

It does this under the control of a sensory system in which receptors on the outside of the bacteria respond to changing nutrient concentrations in its environment. A chemical signalling system tells the flagellar motor to change direction.

It is a nanomachine a millionth the size of a grain of sand that can rotate five times faster than a Formula One engine and can change direction faster than a mosquito beats it wings.

And it's able to change its structure, dynamically, while it is rotating at up to 100,000 rpm — the equivalent of a Formula One car changing the number of pistons in the engine while driving around the track.

What's more, the flagellar motor quite literally builds itself, on demand, out of constituent protein parts, assembling them at the right time and in the right place.

How it became a poster child for intelligent design

In 1978, flagellar motor research pioneer Robert Macnab wondered at this complexity and wrote: "One can only marvel at the intricacy, in a simple bacterium, of the total motor and sensory system."

Then in the 1980s, creationists heard about the motor and started putting it forward as an example of something too complex to evolve by Darwin's gradual process of mutation and natural selection.

By the 1990s-2000s, "intelligent design" creationists had practically adopted the flagellum as their mascot.

Ever since Darwin, creationists have argued that some biological systems could not be produced by a gradual process of small mutations, because they would not be functional when only half-complete. One version of this argument goes:

"What good is half a wing?"

The logic goes that until the final system was completely assembled it would not be favoured by natural selection.

Usually this is accompanied by the suggestion that the only plausible explanation is that a divine power must have created the system all at once via a miracle.

The road to complexity can also involve a change of function

A careful study of evolutionary theory shows that there are more routes to complexity than simple improvement in function.

Darwin himself, just after his discussion of the eye in the Origin of Species, spends pages emphasising and describing an alternative possibility — instead of an improvement in function, there might also be a change of function.

Throughout biology, there are a great many systems that have similar structure and organisation, but different functions — a phenomenon known as "homology".

Darwin pointed out this indicates the same structure can serve many different functions throughout evolutionary history.

One example of this is the penguin flipper.

The penguin flipper is an example of a structure that has served many different functions throughout its evolutionary history. ( Getty Images: Jeff Amantea/EyeEm )

The penguin uses its flipper for swimming, but if we trace its evolution through time there are a series of ancestors that used a similar structure for different functions:

1. Fish-like ancestors with fins for swimming 2. Early amphibians that both walk and swim with their legs 3. Early reptiles that walk on all four limbs 4. Bipedal dinosaurs with forelimbs used to catch prey 5. Dinosaurs with feathered forelimbs used for both climbing and flying 6. Birds that use wings only to fly 7. Birds that use their wings for both flying and swimming 8. And finally — penguins that use their wings for swimming

Similarly, we can use the genetics and structure of the bacterial flagellar motor to find examples in the microbial world that have similar structures but different functions.

This information can then be used to "reverse-engineer" the flagellar motor to work out the common components of its "proto-motor", or evolutionary ancestor.

By doing this, we've found that the building blocks of the flagellar motor are found in many other bacterial systems, serving functions other than motion — including secretion, and energy storage and release.

Although the bacterial injectisome (right) has a completely different function to the flagellar motor (left) they both contain nine proteins that are highly structurally and functionally related, which makes it likely that they evolved from common ancestors. ( ABC )

Experimenting with evolution to fully understand it

These days we can "re-run" evolution in the lab in order to achieve an outcome.

This process of "directed evolution" development has been hugely influential in the biotech and pharmaceutical industries and was the subject of the Nobel Prize for Chemistry in 2018.

Now it's possible to "play it again, Sam" to see what happens the second, third, or 400th time evolution is re-run.

With the bacteria flagellar motor, we've re-run evolution in order to see when changes occur, and if any unexpected outcomes take place.

We've then used statistics to determine the most likely ancestor for separate motor proteins, and genetically engineered these to create a microbial Jurassic Park.

Matt Baker in the lab at UNSW. ( Supplied )

This allows us to investigate what conditions force the flagellar motor to adapt, and helps us understand how complex nanomachines, like the bacterial flagellar motor, can develop new functions over time.

This has applications in synthetic biology where we manipulate bacteria in useful ways that can make a difference to people's lives, especially in healthcare.

For example, if we can make bacteria swim to where we want (by manipulating the flagellar motor), we could use those bacteria to deliver drugs within the body to targeted locations.

Alternatively, we can work to stop the motor in its tracks, which would render bacteria unable to move and limit the spread of bacterial infection in the body.

Along the way, we hope to complement the wonder people feel when they first learn about this complex machine with a comprehensive understanding of how it evolved and how it will continue to adapt in the future.

Dr Matt Baker is a biophysicist at the School of Biotechnology and Biomolecular Sciences at the University of New South Wales. He was selected for the ABC's Top 5 Under 40 program in 2015.

Dr Nick Matzke is a phylogeneticist at the School of Biological Sciences at the University of Auckland who among other things has tracked the evolution of anti-evolution.