Shrek movie is based on on William Steig's 1990 fairy tale picture book Shrek. Shrek is a big ogre who lives alone in the woods, feared by all the people in the land of Duloc.
When Lord Farquaad, the ruler of Duloc, exiles all the fairy-tale beings to the woods, Shrek loses his peaceful life and his home becomes a refugee camp. So he sets out to find Lord Farquaad and convince him to take the fairy-tale beings back where they belong, and leave him alone.
Lord Farquaad accepts, under one condition. Shrek must first go and find the beautiful young princess Fiona, who will become Farquaad's bride. So the big Ogre begins his quest, along with his newfound donkey friend.