So... I'll be the first to say that I'm not a dog-ologist (I think is the term for someone specializing in canines) but I'll throw in my $0.02
Dogs are something like 98% wolf. The vast majority of the remaining 2% difference is a UI to interact with humans.
Of the 98% that are ~wild/wolf, canine society is hierarchical with the lower status animals yielding to the whims of their superiors. But pack dynamics are give-and-take with different things being important to different members. Here in MN we have lots of wolves up north - we even did when I was a little kid (although maybe there were less than 'lots' but the point being that they've either been on the mend since before I was born or were never quite trapped to extinction). MN also has a very comprehensive ongoing wolf study on Isle Royale - which is actually a part of Frog's state (Michigan), as such there are sort of, these wolf interpretive centers here and there. Once when my family was visiting one they were feeding the three wolves that they had there. So they brought in the road-killed deer and the /lowest/ cast wolf started going to town on it and was sort of taking '1st dibs' on the food. The two higher caste wolves were just hanging out waiting for the first wolf to get done eating. One of the patrons watching asked the DNR person or whoever why the higher-caste wolves were eating last. The response was that food wasn't a limited resource, so the pack leaders just didn't really care, but the den for instance was - and the wolf getting first dibs on the food just so happened to be the wolf that had to sleep outside every night.
In the case of your dog, for example. I would posit that it's much less about a complex moral code, rather than a much more straightforward decision tree where you're the pack leader. Food is the limited resource, so if it's untouched - you get first dibs. If you throw it on the floor, or can't finish what's in your bowl - then it's fine for it to be kicked down the ladder for the lower status pack members to have a bite. Similarly, if you decide to take a nap in the same place your dog happens to be taking a nap, she will invariably find somewhere else to sleep - but if it's your kid or another dog where the hierarchy is less clear maybe not so much. Food in your pantry is probably considered to be food you haven't had your go at yet, so it's not her turn, maybe if you started eating a lot of meals in there and just hanging out there generally she'd get a different idea.
Of the 2% non-wolf parts of dogs, which is mostly a UI behind the base wolf back-end code, and the need to navigate a world led by human pack-leaders, a lot of the decision making probably boils down to being delineated by a combination of what makes you (the human pack leader) happy, and what she needs to do to survive and prosper. Relationships are tricky, and so are pack societies, so there are missteps here and there naturally. But by and large most actions are aimed at having your approval ("being helpful" - barking at strangers, etc), avoiding your disapproval (peeing inside, etc), and getting along with other members of the pack (no eating your kids or neighbors, etc). The specifics may sometimes manifest in odd and aberrant behaviors that seem complicated, but it's because you're complicated. If you started getting wildly bent out of shape about the left-over chips, I'm pretty sure she'd stop. But the fact that you think it's amusing/cute enough to write about, is exactly the reason that it's ok for her to do because hey! - dogs gotta eat too..
Just my impression..