Holodecks appear to operate via a combination of holography and replication. Holography is a technique which allows for images to be created which appear 3-dimensional, inasmuch as when the viewer moves, the image changes as though the viewer was watching a 3-d object. I recommend reading the wikipedia description of this method, as the description of how it works is rather lengthy. The other aspect of holography appears to operate via replicators, or through holographic techniques applied to force fields so as to emulate solid matter (that is, the projection of force fields). Since no one has invented a holodeck yet, however, any answers as to the means by which it functions are of course speculative.