I used to play sports professionally at junior level and I experienced what you described quite a few times. At that time, I did not understand it in any way, but it was clear to me that some sort of "trance" was happening under certain conditions, and I would basically fully focused on the game as if nothing else mattered or even existed.
The things that helped me reach that state were motivation, being under slept or slightly tired, being sick.
I didn't have the concept of "flow" at that time, but I remember noticing that flow in important games without having the concept of it. It almost feels like you have to reduce your active conscious thoughts in order to get there, and just allow your instincts to take over.
Other people have mentioned various other games, musical instruments, typing, etc.
Anything you've practiced sufficiently becomes like breathing or walking. You don't consciously think about these things, you've done them for so long they just happen. The memory of them is so embedded in you that you don't really have to actively work to recall it.
What we call "muscle memory". You've done some actions so often that the action stops being "Put a finger on this fret, pick this string, wait this long, now lift the fretting finger, ..." and becomes "play this song/scale/technique". The whole performance becomes a single action in your mind. It stops being "hit the keys W O R D" and becomes "type 'word'".
And then when you focus on it again, you start noticing the individual actions and you again have to think about every piece of the activity.
I think with you, it sounds like you needed something to lower your inhibitions a bit. Just enough to trust that you're going to do the thing. And normally, you don't trust yourself, so you focus on the steps of the action. It's why people say they perform better after getting slightly inebriated. They're no longer hindered by their inhibitions.
For me, it tends to happen more when I'm fully rested. My body feels like a well oiled machine, and my emotions seem fairly muted. It's a state of just "doing", with a sense of peace (neither especially happy, nor sad).
Replicating it tends to involve just getting on with the task at hand, without too much thinking about the end goal.
The things that helped me reach that state were motivation, being under slept or slightly tired, being sick.
I didn't have the concept of "flow" at that time, but I remember noticing that flow in important games without having the concept of it. It almost feels like you have to reduce your active conscious thoughts in order to get there, and just allow your instincts to take over.