It kept the holodeck characters oblivious to anything outside the parameters of the program. This allowed a participant of the program to give computer commands to the holodeck system without the characters responding to such an action. It also kept the characters from realizing that they were holograms. Running a holographic program for an extended period of time uninterrupted can cause the perceptual filters to malfunction.
In 2376, such a malfunction occurred within the Fair Haven program on the USS Voyager. Many characters within the program, including Michael Sullivan, began to question the strange activities of the members of the Voyager crew in the program. This included Tom Paris using the computer to repair a tire on his primitive car, and turning one of the characters, Maggie O'Halloran, into a cow as a joke. The malfunction was so advanced that when Paris and Harry Kim attempted to fix the Sullivan character in Voyager's holographic lab, he pretended to be a part of the program when he realized he was in another place. After convincing the characters that they meant them no harm, the Voyager crew repaired the problems. (VOY: "Spirit Folk")