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.
Perhaps it is the illusion of choice and the choice you make was always going to be that one due to all of the events that shaped you and the events that shaped the people that shaped you etc all the way back to the big bang.
I contemplate this from time to time.
Yes, that’s the question: if our acts are predetermined all the way back to the big bang, as you suggest, why do we feel that we determine them?