The other answers have the right spirit, but aren't exactly canonical. Here is an answer that takes into account only what is currently known about Holodeck technology of that era.
First, why the era matters. If you remember, way back in episode #1 of TNG, Data tosses a rock at the Holodeck wall and it hits. This early Holodeck tech used a variety of techniques to create the illusion of there being more space than there really was. However, it was not yet able to create enough space to prevent Data from striking the wall.
As the show went on, the holodeck received upgrades. Ultimately, at the end of TNG, they were able to trick Geordi's visor and to create convincing illusions of large spaces. (cave networks, large distances, so on)
Then, by the time of Voyager, the holodecks were capable of doing even more astounding feats. Such as being a venue for skydiving or space flight (gravity manipulation, wind control) and in one case, being linked together into a giant network of holodeck rooms to simulate a Nazi occupation.
The events of Generations takes place during Season One of Voyager, so the holodeck technology of Generations is roughly equivalent to Voyager's level. These are the most sophisticated holodecks shown in all of ST history. And the trick we are trying to achieve is no more complicated than projecting holograms on the walls of the room.
Holograms, unlike traditional projection, use light wave interference to imbue a flat sheet with different images depending on the angle that the image is viewed from. In this case we are talking about a 3D projection of another part of the holodeck. Clearly, whomever programmed the ship simulation thought it would be cute to put the arch there. As for walking past the arch (and into a wall) that can also be achieved with similar tricks that involve moving people without them knowing.