Eleanor "Nell" Lance (Lili Taylor) has cared for her invalid mother for 11 years. After her mother dies, her sister Jane (Virginia Madsen) and Jane's boyfriend Lou (Tom Irwin) eject her. Nell receives a phone call about an insomnia study, directed by Dr. David Marrow (Liam Neeson) at Hill House, a secluded manor in the Berkshires of western Massachusetts, and applies for it. At the house, she meets Mr. and Mrs. Dudley (Bruce Dern, Marian Seldes), a strange pair of caretakers. Two other participants arrive, Luke Sanderson (Owen Wilson) and Theodora (Catherine Zeta-Jones), along with Dr. Marrow and his two research assistants. Unknown to the participants, Dr. Marrow’s true purpose is to study the psychological response to fear, intending to expose his subjects to increasing amounts of terror. Each night, the caretakers chain the gate outside Hill House, preventing anyone from getting in or out until morning. During their first night, Dr. Marrow relates the story of Hill House. The house was built by Hugh Crain (Charles Gunning)—a 19th-century textile tycoon.
Crain built the house for his wife, hoping to populate it with a large family of children; however, all of Crain's children died during their birth. Crain’s wife Renee killed herself before the house was finished and Crain became a recluse. After the story, Marrow's assistant’s face is slashed by a snapped clavichord wire. The freak accident causes Marrow's research assistants to leave. Nell begins to suspect that it was no accident, as she notices that the wire was unwound by someone or something. Theo and Nell begin to experience unusual happenings within the house, such as a mysterious force trying to open the door, Nell starts seeing ghosts of children in curtains and sheets, Hugh Crain's wood portrait morphs into a skeletal face and is vandalized with the words "Welcome Home Eleanor" written in blood. Theo and Luke try to establish their innocence, but Nell tells them that they don't know her.
Nell becomes determined to prove that the house is haunted by ghostly children who are only terrorized and killed by Crain's cruelty. She learns that Crain kidnapped the children from his cotton mills and slaughtered them, then burned their bodies in the fireplace, trapping their ghosts and forcing them to remain with him, providing him with an 'eternal family'. She also learns that Crain had a second wife named Carolyn, from whom she is descended. Dr. Marrow is skeptical of Eleanor's claims, until he realizes he made a mistake by bringing them to Hill House when a statue tries to drown him in a pool of water in a greenhouse. After several more terrifying events, Nell insists that she cannot leave the ghosts of the kids to suffer for eternity at Crain's hands. Trying to convince Eleanor to leave the house with them, Theo offers to let Nell move in with her, but Nell reveals her relation to Carolyn and claims she must help the children to "move on" to the afterlife.
Hugh Crain's ghost seals up the house, trapping them all inside. A frustrated Luke defaces a portrait of Hugh Crain. Crain's enraged spirit drags Luke to the fireplace where he is decapitated. Nell is able to lead Crain's spirit towards an iron door. The spirits pull Crain into the door, dragging him down to Hell. Nell is pulled with him, inflicting fatal trauma on her body, but the ghosts gently release her on the ground. Her ghost rises up to Heaven, accompanied by the children's ghosts. After Nell's death and when she moved on to Heaven along with the ghosts, Theo and Dr. Marrow wait by the gate outside until the Dudleys come in the morning.
The Dudleys approach as the sun rises. Mr. Dudley asks Dr. Marrow if he found what he wanted to know, but the traumatized psychiatrist does not give an answer, and neither does Theo. When the gate opens, the two silently walk out and down the road, leaving Hill House behind them.

Question: Who is trapping the ghost children in Hill House?
Answer: Hugh Crain's ghost.