Quoted By:
I once read that the holodeck uses the same forcefields it uses to do everything as tredmills. So I'd imagine people on the holodeck perceive each other as being further or closer away, but that's all just optical illusions. Hell, with how solid those forcefields are, you could even "stack" people. What I'd question is how those forcefields created sensations that are realistic to the touch. That's the kind of shit that's just plain weird.
However, in the end it's just sufficient technology being indistinguishable from magic and all that. The holodeck is simply a device which you can use in writing. Like how you can show Data's android personality by making it clear he doesn't get the point of Sherlock Holmes. In TNG it represented the optimistic, wholesome future that was also clearly more advanced than TOS. People in TNG also always used it for these goody-two-shoes purposes, completely in line with the space cadet attitude of that show. I found that to be pretty annoying. DS9 showed it more like an entertainment utility that was basically an advanced video game set.
At that, I like where they eventually took it. It became less of a magical box and more of a full-contact video game, with (more or less) clearly established rules and more effort going into making a decent experience than saying "make it so".