Prior to Odysseus's cunning plan to sneak his men out of Polyphemus's cave by tying them underneath sheep so that the Cyclops cannot feel them, he first needs to blind the Cyclops so that the monster will not be able to see them. Odysseus knows that if he simply kills Polyphemus, he and his men will never be able to move the stone away from the door to the cave and that they will all perish in the cave together. Thus, he knows he must injure the Cyclops in a way that will make it more difficult for the monster to catch them but so he can still move the stone.
When Odysseus left his ship, he'd brought with him a skin of very potent wine given to him by Maron, a priest of Apollo, in Ismarus. He essentially gets Polyphemus drunk on this wine, waits until the monster passes out, and then blinds the Cyclops with a stake he and his men have sharpened and hardened in the fire. Now, the monster will not be able to spot Odysseus and his crew as they are tied under the sheep, and he will only think to feel for the men on top of the sheep (because he's not as cunning as Odysseus is).
Even before he blinds the Cyclops, crafty Odysseus has told the Cyclops that his name is Nobody (or No one, depending on your translation) After Odysseus blinds the Cyclops, he and his men escape by hanging onto the undersides of sheep. As the sheep pass by the Cyclops to go out to graze, the Cyclops runs his hand over the tops of the sheep - to make sure they are sheep and that Odysseus and his men aren't riding out. They escape that way. As the Cyclops calls to his brothers all he can say is that Nobody has hurt me. Odysseus, however, can't seem to be quiet, and after he and his men are safely away from the Cyclops, Odysseus reveal his name to the Cyclops. Not a good idea as the Cyclops is a son of Poseidon (who is already angry with Odysseus).
Odysseus has his men tie themselves under the sheep, so that when the sheep leave the cave, the Cyclops (now going only by feel), will feel the sheep to make sure no humans are among them, but will miss them.
This is another one of tales in Homer's Odysseythat is used to show the intellect and cunning of Odysseus. After Odysseus blinds Polyphemus, he must still get out of the cave. The only in our out of the cave is blocked by a gigantic boulder which is far too large for Odysseus and his men to move. However, Odysseus figures out that Polyphemus will need to let out his sheep for grazing in the morning and so he will have to move the boulder. Odysseus devises the plan for him and his men to hide underneath the sheep as they pass out of the cave. Polyphemus is using his hands to feel everything that leaves so as not to allow the escape of the men. This allows Odysseus and his men to get by unnoticed. However, Odysseus, after winning the day, shows his hubris as he screams back to Polyphemus "It is I Odysseus who blinded you". This later brings the wrath of Polyphemus' father, Poseidon.