is randomly logical stuff, random because there are many paths and many interruptions to particular result, logical because after practice and training, better and high probability path for result may emerge
if sou exists, all the chemical and physical reaction above in brain layer should not exist, because processing unit should be out of the body but in other place just like client and server(cloud) mode.
Virtual reality, you can build a world vivid like what we are experiencing now if you born with perception of current physical world. Chips in your brain can emulate all signal of your perception and sense and combine the super reality of interaction and view in the game world, so that you can not distinguish the virtual from the reality. I you are born with virtual reality chip implanted in your brain, even the virtual is completely fantastic and different from our physical world, you can not easily recognize it because you have adapted to it just like you can not judge whether you are in a dream even with different identity.