The idiom comes from Aesop's fable about a dog who lies in a manger filled with hay, preventing the oxen from eating. The dog cannot eat the hay itself, but it refuses to let the oxen have it.
This idiom is used to describe people who are selfish and possessive, even if they don't have any real need or use for what they are guarding.
Here are some examples of how the idiom can be used:
* "She's a real dog in the manger; she won't let anyone use the spare room, even though she never stays there herself."
* "The company is acting like a dog in the manger by refusing to share its technology with other businesses."
* "He's just a dog in the manger, hoarding all the resources for himself."
The idiom can be used to express criticism, annoyance, or humor when someone is behaving in a selfish and unproductive way.