Three possibilities come to mind:
Is there an evolutionary purpose?
Does it arise as a consequence of our mental activities, a sort of side effect of our thinking?
Is it given a priori (something we have to think in order to think at all)?
EDIT: Thanks for all the responses! Just one thing I saw come up a few times I’d like to address: a lot of people are asking ‘Why assume this?’ The answer is: it’s purely rhetorical! That said, I’m happy with a well thought-out ‘I dispute the premiss’ answer.
I like to look at the illusion of free will as if you’re falling down a pit. You can try to flap your arms or swim, and maybe move yourself a little bit, but at the end, you’re still falling down.
Warning, I came up with this while very high one time, lol, but it’s kind of stuck with me:
Consciousness is a 4-dimensional construct living in a 3-dimensional world. What we experience as the passage of time is just our consciousness traveling/falling along the surface of the 4-dimensional plane/shape that defines our existence.
Feel free to poke all the holes you want in that. lol
This is basically a spacetime worldline, which is one of those terms that sounds like scifi technobabble even though it’s an actual concept