Illusion of free will is not like a meme. You experience it. — bahman
Get back to basics. The sense of self is a perceptual contrast the brain has to construct so as to be able to perceive ... "the world". Even our immune and digestive systems have to encode some sense of what is self so as to know what is "other" - either other organisms that shouldn't be there, or the food the gut wants to break down. And so too, the brain has to form a sense of what is self to know that the world is other.
A second basic of the evolved brain is that it is needs to rely on forward modelling the world. You probably think the brain is some kind of computer, taking in sensory data, doing some processing, then throwing up a conscious display. Awareness is an output. But brains are slow devices. It takes a fifth of a second to emit a well learnt habitual response to the world, and half a second to reach an attentional level of understanding and decision making. We couldn't even safely climb the stairs if we had to wait that long to process the state of the world.
So instead, the brain relies on anticipation or prediction. It imagines how the world is likely to be in the next moment or so. So it is "conscious" of the world ahead of time. It has an "illusion" of the next split second just about to happen. That creates a feeling of zero lag - to the degree the predictions turn out right.
And this forward modelling is necessary just to allow for a continual perceptual construction of our "self". We have to be able to tell that it is our turning head that causes the world to spin, and not the other way round. So when we are just about to shift our eyes or move our hand, a copy of that motor instruction is broadcast in a way that it can be subtracted from the sensory inputs that then follow. The self is created in that moment because it is the part we are subtracting from the flow of impressions. The world is then whatever stayed stable despite our actions.
It is not hard to look at the cognitive architecture of brains and see the necessary evolutionary logic of its processing structure. And a running sense of self is just the flipside of constructing a running sense of the world.
Then on top of that, brains have to deal with an actual processing lag. And the best way to deal with that is to forward-model the shit out of the world.
Then on top of that, it is efficient to have a division of labour. The brain wants to do as much as it can out of learnt habit, and that then leaves slower responding attention to mop up whatever turns out to be novel, surprising or significant during some moment.
That leads to consciousness having a logical temporal structure. You have some kind of conscious or attention-level set of expectations and plans at least several seconds out from a moment. About half a second out, attention is done and learnt, well-briefed, habit has to take over. It does detailed subconscious predicting and reacting. If someone steps into the road while you are driving, you hit the brakes automatically in about a fifth of a second. After that, attention level processing comes back into it. You can consciously note that thank god you are so quick on the brakes, and what was that crazy guy thinking, and why now is he looking angry at me, etc.
So [conscious prediction [subconscious prediction [the moment] subconscious reaction] conscious reaction].
This is all proven by psychological experiment. The whole issue of reaction times and processing times is what got experimental psychology started in the late 1800s.
Where does human freewill come into it? Well what I've outlined is the evolution of the cognitive neurobiology. The basic logic is the same for all anmals with large brains. They all need to construct a running sense of self so as to have a running sense of what then constitutes "the world". They all have a division of labour where they can act out of fast learnt habit or slower voluntary attention.
But humans are different in that we have evolved language and are essentially social creatures mentally organised by cultural evolution. Yes, memes.
So now our perceptual sense of self takes on a social dimension. We learn to think of "ourselves" in terms of a wider social world that we are representing. We learn to "other" our biological selves - this running perceptual self with all its grubby biological intentionality - and see it from an imagined social point of view. We learn to be disembodied from our own bodies and take an introspective or third person stance on the fact we can make choices that our societies might have something strong to say about.
So freewill is a social meme. It is the cultural idea that being a human self involves being able to perceive a difference between the "unthinking" selfish or biologocally instinctual level of action and a "thinking", socially informed, level of self-less action.
An animal is a self in a simple direct fashion - a self only so far as needed to then perceive "a world". A human, through language, learns to perceive a world that has themselves in it as moral agent making individual choices. That then requires the individual to take "conscious responsibility" for their actions. Every action must be judged in terms of the contrast between "what I want to do" and "what I ought to do".
So the idea of freewill is an ideal we strive to live up to. And yet the temporal structure of actual brain processes gives us plenty of dilemmas. We do have to rely on "subconscious" habit just for the sake of speed and efficiency. The gold standard of self-control is attention-level processing. But that is slow and effortful. However - as human culture has evolved - it has set the bar ever higher on that score. As a society, we give people less and less latitude for sloppy self-control, while also making their daily lives fantastically more complex.
A hunter/gather level of decision making is pretty cruisey by comparison. You go with the flow of the group. Your personal identity is largely a tribal identity. You get away with what you can get away with.
But then came institutionalised religion, stratified society, the complex demands of being a "self-actualising" being. A literal cult of freewill developed. The paradoxical cultural demand - in the modern Western tradition - is that we be "self-made".
So sure, there must be some evolutionary logic to this. There must be a reason why the freewill meme is culturally productive. But the point also is that it is a psychologically unrealistic construct. It runs roughshod over the actual cognitive logic of the brain.
We just shouldn't beat ourselves up for not being literally in charge of our actions at all times. We are designed to be in some kind of flow of action where we let well-drilled habit do its thing. And of course our minds will wander when we are being expected to consciously attend to the execution of stuff we can handle just as well out of habit. The idea that we can switch our concentration off and on "at will" just cuts against the grain of how the brain naturally wants to be. Attention is there for when things get surprising, dangerous, difficult, not for taking charge of the execution of the routine.
So "freewill" sits at the centre of so much cultural hogwash. There is good cultural reasons for it as a meme. It is really to modern society's advantage to have us think about our "selves" in this disembodied fashion. It allows society to claim control over our most inadvertent or reflexive actions.
But it is also a demonstrably unhealthy way to frame human psychology. If we just recognise that we have slower voluntary level planning and faster drilled habitual responses, then this unconscious vs conscious dilemma would not create so much existential angst.
We are not a conscious ego in possible conflict with an unconscious id (and also under the yoke of a social super-ego). Our "self" is the skilled totality of everything the brain does to created a well-adapted flow of responses to the continually varying demands of living in the world - a world that is both a physical one and a social one for us as naturally social creatures.
The actual freewill dilemma arose because Newtonian determinism appeared to make it paradoxical. If we are just meat machines, then how could we be selves that make our own rational or emotional choices?
But physics has gone past such determinism. And the very fact that the brain has to forward model to keep up with the world means that it is not being neurally determined anyway. Its knowledge of how the world was an instant or two ago is certainly a constraint on the expectations it forms. But the very fact it has to start every moment with its best guess of the future, and act on that, already means we couldn't be completely deterministic devices even if we tried.
Universal computation is logically deterministic. A programme - some structure of set rules and definite data - has to mechanically proceed from an input state, its initial conditions, to an output state.
But the brain is not that kind of computer. So it is neither physically deterministic (as no physics is that in the LaPlacean sense), nor is it computationally deterministic.
Thus "freewill" just isn't a real ontological problem. There is no metaphysical conflict. (Unless you are a dualist who believes "mind" to be a separate substance or spirit-stuff. And of course there are many who take that essentially religious view still. But for psychological science, there just isn't an ontological-strength problem.)