Bear with me on this. I think this is roughly what happens, but it's just a guess. I'm not a programmer, and I could be way off.

Anyway, let's imagine a peep has 100 possible actions. With no "outside" factors in operation, the chances are one in 100 that the peep will carry out a particular action. Let's say a peep (ours or another one) has put a meal on the table. This "outside" factor will increase the likelihood of our peep choosing to eat. Then there's the factor of how empty our peep's belly is. A full bar will decrease the chances and an empty one will increase them. Then again there's "training". If we give them the green hand when sitting down to eat the chances go up, and the opposite if we use the red hand.

The important thing to remember is that I am talking about "chances" that they'll carry out a particular action. There's still a chance that they will decide to do something else instead. As I said, I'm not a programmer, and I don't know what weighting Arthur gives to the various actions and the factors that affect them. It does mean, though, that our peeps can appear delightfully scatter-brained, sometimes stubborn, with what seem to be their random actions.
_________________________
To err is human; to arr is pirate.