how are dogs so smart.

I get home from a friends from the bar, my dog welcomes me home. I play with her for a few minutes until later on I realize hey I had some chips on my counter I wanted to eat. I look around. No where to be found. While during the time my 5 month old pit/lab pup is on the couch watching me ( as she normally does) and I'm confused like I just had those bag of chips there before I left. I look down and I see the chips empty with my face looking disappointed I look over and my pups ears are back and she jumps off the couch with her tail down heads to my room. I said nothing to her during this time and then by her actions I caught on. How are dogs this smart? Yes she felt guilty but I didn't even say a word to her thinking it was her. 
I picked her up( yes she's heavy) and I told her I wasn't mad. 
I guess underestimated a Dogs intelligence until now. Wow.