The Ogres of fiction are typically humanoid creatures of hulking size, ferocious appetite, and predatory ways. However, their roles in stories can vary greatly depending on the author, the geographic origin, and the period of a tale.
The word "ogre" seems to derive from the Italian "orco" or "orca". The influential tales of Giambattista Basile (c. 1575-1632) depict Ogres both malevolent and benevolent. Their appearance is invariably "beastial", and "disfigured". But their fearsome exterior can disguise their kindness and surprising humanity. These tales taking a stance against prejudice based on looks. The Ogres here can serve as benefactors to the protagonists. Bestowing wealth and/or magic items to the figures who managed to win their allegiance.
The tales of Charles Perrault (1628-1703) on the other hand place more emphasis on the violence of an ogre. For example the ogre of "Hop-o'-My-Thumb", cuts the throats of sleeping children. The ogres of Perrault, or the Brothers Grimm, feast on human flesh, abduct children, violently assault strangers. The "ogre" becomes a synonym of the cannibal, or the devourer. A byword for violent death.
The tales often display the naivety or outright stupidity of the ogres. Even magically-empowered ogres tend to be outwitted by trickster heroes of small size. The protagonists then goes on to lay claim to the wealth and magic of his/her fallen foe.