Ron Decker, a young man convicted for drug possession, is sent to prison where veteran con Earl Copen takes Decker under his wing and introduces him into his own gang. Copen first helps out Decker when three Puerto Ricans attempt to lure him into a cell block to rape him, however Copen sees through their plans and talks to the Puerto Ricans, who quickly abandon interest in Decker. Over the next few days, Copen helps Decker out by getting him better jobs, food, and even transferring him to his own cell block. Mainly however Copen helps Decker's case and points out that under a new article passed by the legislature, a judge can modify a sentence in the first 90 days if he sees fit, so Copen helps write false reports and gives Decker advice to stay out of trouble, which will make Decker appear as a "very small threat to society". However, after large inmate Buck Rowan attempts to rape Decker in the bathroom, Decker stabs Rowan in a fight involving Copen, paralyzing Rowan. Rowan signs a statement claiming Decker and Copen are responsible and their cells are stripped and they are restricted to them. Because of the stabbing, Decker's attempt at a modified sentence is denied and his sentence remains five years. Meanwhile, Copen manages to get word out Rowan is "snitching", and an inmate working at the infirmary poisons Rowan's IV with cleaning fluid. The case against Copen and Decker is thrown out as the victim and main witness is dead. Shortly after their release, Copen tells Decker he plans to escape, and they plot to hide in a garbage truck and avoid being crushed by the compressor by using a bar to stop it. Decker escapes in one truck, Copen however stays behind, unable to jump into the truck after the appearance of one of the prison guards. Decker manages to flee to Costa Rica and Copen stays behind, after stating "This is my prison, after all" and quoting Satan from Paradise Lost by John Milton: "Better to reign in hell than serve in heaven."
Animal Factory was filmed at Holmesburg Prison in Philadelphia, Pennsylvania. Filming was completed in 30 days, two days longer than originally scheduled. Buscemi employed hundreds of prisoners from Curran-Fromhold Correctional Facility, the prison that replaced Holmesburg Prison in 1995. The film is based upon the novel of the same name by writer Edward Bunker. Bunker, who has a small part in the film, also co-starred alongside Animal Factorys director Buscemi in Quentin Tarantino's Reservoir Dogs.