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.
No, but you have the ability to sense your heartbeat, so you can tell that it’s there.
You don’t have the ability to sense electromagnetic emissions in the X-ray frequency range, so you can’t tell that they’re there. You wouldn’t know if X-rays of a given intensity were present at a given moment. It’s like asking “why is there the illusion that there are no X-rays” when you wouldn’t expect to feel differently regardless of their presence or non-presence.
But my body also takes actions which I don’t control and of which I’m not conscious. E.g., normal cell death and replacement (granted, I would eventually notice if this stopped, but not in the short term). I don’t have the illusion of control over those actions, but I do have a sense (real or not) of control over others. My question is, why do I have that sense if it’s not real?
The premiss involves the idea that it would feel different, that my deliberate acts would feel (like cell replacement) like a thing that happens, rather than a thing I’m doing. Granted, if I were unconscious of all my acts, it wouldn’t feel like anything (like my experience of x-rays, which is a non-experience), but then I would be unconscious. So, if I’m interpreting you correctly, are you suggesting that the sense of will is a property of consciousness, and that consciousness is itself an emergent property of sensory experience?