They think ahead, that is why they act like that. When you leave they think you will be gone for 8 hours, so when you come back it's party time. They are just bundles of love and compassion.
Today when I was walking the doggy I went left at the street, and he usually knows it means a short walk as I take the next left and head for home, but today when we were getting close to that final turn, he was dragging his butt, walking real slowly, but then I went straight, and I could see his expression change and he ran past me to sniff ahead again, tail wagging, all happy. It's cute.