Bacteria are some of the simplest organisms, yet they are capable of surprisingly complex behavior. When Bacillus subtilis bacteria, a species normally found in the human gut, are placed in a drop of water, the organisms create a vortex, with bacteria on the outside swimming in one direction and the ones on the inside swimming the opposite way.

"There was no intuitive way to explain what was happening with the dual-motion vortex. It was very puzzling," Enkeleida Lushi, an engineer at Brown University in Rhode Island and lead author of the study, published Monday (June 23) in the journal Proceedings of the National Academy of Sciences, said in a statement.

Now, Lushi and her colleagues may have found an explanation for the strange behavior. A computer simulation revealed that as the bacteria along the edges swim in one direction, they push the fluid backward, forcing the inner bacteria to swim in the opposite direction. [See video of bacteria swimming in a vortex]

The phenomenon is an example of individual units in nature working collectively, the researchers said. Understanding this behavior may help researchers figure out ways to control it, which could prevent infections in the human body from spreading.  

Researchers from the University of Cambridge in the United Kingdom demonstrated the vortex phenomenon in 2013, but they couldn't explain why the microbes behaved in this way. Lushi was also at Cambridge when she started working on the problem.

First, Lushi developed a simulation that modeled only the mechanical interactions between individual bacteria. The model showed that bacteria swimming randomly in a confined circular space tend to orient toward each other with the same angle relative to the circular edge. 

But this didn't explain why organisms on the inside of the circle moved in the opposite direction as those on the outside. The bacteria are only a fraction of the width of a human hair, so the fluid feels very viscous to them, the researchers said.

Next, Lushi and her colleagues created a simulation that incorporates the fluid flow generated as the bacteria move. The microbes swim using little corkscrew-shaped devices called flagella, which propel the bacteria forward while pushing fluid backward. [See video of bacteria swimming in a vortex]

In this simulation, the bacteria aligned themselves in the same direction around the edges, producing a flow in the opposite direction. The microbes in the middle can't swim against this current, so they move with it — resulting in the swirly vortex pattern.

"It's a very basic model, but in the end, it captures this phenomenon very well," Lushi said. "It showed that any study of microbes suspended in a liquid should not ignore the motion of that liquid —it could have important repercussions on the microbes."

Follow Tanya Lewis on Twitter and Google+. Follow us @livescience, Facebook & Google+. Original article on Live Science.