Fruit flies and other simple organisms might seem like they're creatures of instinct, governed by a set of basically predictable stimuli and responses. But fruit flies actually have free will. Depending on what your definition of free will is.
Leaving philosophy aside, we know humans have free will because we're able to evaluate a set of different options and make a conscious decision as to which of them we're going to choose. But for animals, we can't ask them how they go about making decisions, so figuring out whether they possess free will in a biological sense is much trickier.
There are a couple possible ways to describe how animals behave, neither of which suggests free will. The first is that animals act in a deterministic way, meaning an animal presented with a particular stimulus over and over again will respond in the exact same way every single time. Then there's random behavior, in which an animal has completely unpredictable responses at all times. The former suggests an animal governed by instinct, the latter a creature ruled by chaos. Neither suggests an animal capable of free will as we understand it.
But the truth seems to lie somewhere in the middle, and that's where things get interesting. New research by Bjoern Brembs of the Berlin Free University attempted to simulate the brain activity of fruit flies using mathematical models. He found that the best match for the brain activity was a mix of deterministic and what's known as stochastic behavior - behavior that appears random at first but, given enough time, follows a well-defined probability curve.
The deterministic side of the model suggests instinct still plays a role in how fruit flies function - some things really will provoke the same reaction every single time - but other situations reveal the ability to react in different ways within a given range of probabilities. Brembs explains:
"It is a probability, and that's as far as we can take it if we try to abstract it from thinking. In thinking, we have all the options, and theoretically all the options have the same probability attached to them. However, this is not how it's going to turn out."
What does that mean? Well, let's say you're standing at the edge of a cliff. In theory, there's a 50/50 chance you'll either walk off the edge of the cliff or back away from it. If we were a totally random species, then half of all humans placed in that situation really would hurl themselves to their deaths. But almost no humans are going to choose to end their lives when placed in that situation, as most will make a conscious decision to ignore any dangerous impulses and walk away.
That's a very basic example of stochastic thinking, and something similar to that appears to be happening with fruit flies, based on how well the partially stochastic model describes their brains. Fruit flies and other animals seem to have mechanisms built into their brains that can determine just how probabilistically they should react to a given scenario - in one where all available options are roughly as good as each other, the fly is likely to pick at random, while a situation where only one choice doesn't result in death will lead to a pretty much instinctual response.
It's free will as a survival strategy. Look at it from the perspective of prey - an animal that's being hunted doesn't want to be so completely predictable that a predator can easily figure out what it's about to do, but it doesn't want to be so utterly random that it places itself in even greater danger than it was in with the predator.
So what's going on in the fly's brains? Brembs doubts they're consciously thinking about their decisions in the same way we do:
"I would not expect fruit files or worms to comtemplate their options; I would think this is something that is clearly more built in than it is with us. But I would then say that most of the decisions we're making are also built in. [Free will as described in the paper] is a very low-level, necessary prerequisite, but it's not even close to being sufficient for addressing things like morality and responsibility. But without this very basic capability of choosing between options, we wouldn't have to think about all the other things that come on top: consciousness, upbringing and what have you."
So then, there's free will in a biological, evolutionary sense, a vital survival strategy that all organisms from fruit flies to humans probably have. Then there's free will in a philosophical sense, something likely enjoyed only by humans...and something that, at least for now, science still can't really say all that much about.