Immersion is a mental state of some sort.
Categorising mental states is notoriously difficult! There are cognitive states, volitional states, emotional states, etc and of course many of these overlap and interact in incredibly complex ways.
Being immersed in a fiction seems to be most often a description of a type of "withdrawal" from the ordinary processes of paying attention to and responding to the world around; because instead one's cognitive focus is on an imaginary situation, and that is what one is emotionally responding to.
In the context of a RPG, as well as that sort of immersion there can be other sorts too. For instance, there can be
volitional immersion whereby I as a player want the same things that my character wants. And this can itself take different forms: I might volitionally immerse by way of imaginative projection of myself into the character's situation, so that (metaphorically speaking) I "become" that other person; or, I might volitionally immerse by setting up the game in such a way that my real-world motivations as a player align with the motivations of my character in the fiction. The impression I get from Gygax's rulebooks is that his table favoured that second form of volitional immersion.
My own approach to immersion, which I suspect is similar to
@Neonchameleon's, is to imaginatively project into the character/situation, and then to rely on the system - the processes of play, the resolution techniques, etc - to support and sustain rather than interfere with or contradict that imaginative projection. This has multiple aspects to it, and I think they're fairly complicated to analyse, but a couple are: (i) the system shouldn't generate incentives for me as a player that push
against the motivations I am embracing via imaginative projection; (ii) the system shouldn't throw up situations that repeatedly
contradict the true beliefs I am projecting myself into.
An example of a system satisfying (i): the 4e paladin at-will attack Valiant Strike makes the paladin stronger (ie to-hit bonuses) when surrounded by foes. The system therefore supports rather than undercuts the motivations that are part of being a paladin - ie to valiantly enter the fray!
And further thoughts on (ii): the notion of
true beliefs is central to how I've stated it. If my character's beliefs are meant to be up for grabs, than of course the system needs to (potentially) challenge them. But (to go back to the paladin example) if I am playing a character who is, in truth, divinely inspired, and if that is part of what the character knows - and this is true for any D&D cleric or paladin - then the system will undermine immersion into this character's situation if it repeatedly throws up situations that contradict that knowledge of the workings of providence. Classic D&D has a tendency to do this, which is consistent with its sword-and-sorcery inspirations but inconsistent with having clerics and paladins (as opposed to warlocks and sorcerers). 4e D&D, on the other hand, is very good at not doing this.