It implies that someone is so easily persuaded or manipulated by another person that they will do anything they are told, just like a pet that is eager for a treat and will do anything to get it.
Here are some examples of how the idiom might be used:
* "The puppy was eating out of my hand, so I was able to teach it new tricks easily."
* "He's been so busy with work lately that his kids are practically eating out of his hand."
* "The politician's charm has the voters eating out of his hand."
It's often used in a humorous or ironic way, especially when someone is being taken advantage of.