The storyline of the film follows the book fairly closely. Charlie Bucket (Peter Ostrum), a poor but good-natured boy, finds a golden ticket in the wrapper of a Wonka candy bar, entitling him to a lifetime supply of chocolate and a tour of the Wonka factory. He's joined by four other beastly children, as well as Willy Wonka himself (Gene Wilder), who has created a wondrous fantasyland in his factory. The other four children suffer various outlandish mishaps during the tour, leaving Charlie the only one still around at the end. Wonka rewards him by making him owner of the factory.
Though the movie generally adheres to the events in Dahl's book, several minor changes can be seen. The most prominent is a character known as Arthur Slugworth (Gunter Meisner), a rival of Wonka's, who is mentioned in the book but never appears there. He has a substantial subplot in the movie: attempting to bribe Charlie into stealing the secrets of Wonka's factory for him. Other changes were necessary because the budget and special effects of the time couldn't recreate certain parts of Dahl's tale: most notably the final fate of Veruca Salt (Julie Dawn Cole), who was thrown down a garbage chute by squirrels in the book. In the movie, the scenario involves geese instead of squirrels.
The film was the brain-child of producer David L. Wolper and director Mel Stuart, who convinced the Quaker Oats Company to purchase the rights to the book and finance the production. Quaker was working on a new candy bar and felt that Willy Wonka would make an outstanding way to promote it. (That was the primary justification for changing the title.) The film was shot in Bavaria, Germany, which provided a suitable fairy-tale atmosphere. The effects were primitive by today's standards, but they retained an essential charm as well as adhering to the spirit of Dahl's novel.
The film central coup was casting Wilder in the title role. The actor was well-known for parts in "The Producers" and "Bonnie and Clyde," but he had not yet soared to the heights of fame he later reached with "Young Frankenstein" and "Blazing Saddles." He famously agreed to the part on one condition: that the producers allow him to make his first entrance limping on a cane, only to toss it aside and perform a somersault in front of the surprised children.
Though well-received by critics, "Willy Wonka & the Chocolate Factory" did not initially perform well at the box office. Quaker Oats abandoned the production and there was little money left for promotion. Television and video sales in later years allowed it to find its audience, however. Fans responded to its mixture of child-like whimsy and underlying creepiness, as well as several memorable songs performed by Wilder and the cast. The musical score received an Oscar nomination in 1971, and Wilder earned a Golden Globe nomination for his performance.