Louis learns pretty quickly when food is involved. He also has his own calculations as to when he is due a treat.
He considers that, when you’re out walking, he deserves a treat about every 50 paces. He lets you know this by touching the back of your hand with his wet snout. This means it’s time to load up with a treat or suffer more wet snout assaults.
I think he sees us as bipedic vending machines. Here’s a pic of Louis giving me a “the vending machine isn’t working – it better get fixed quickly” evil look.