Some dogs have allot more brains than other = genetics. Some dogs actually have reasoning skills. I see this with my breed during training sessions.
I do think they live in the moment for some things and they most definitely react to emotions..... but I also believe some breeds have great memory skills.
This dog either needs a job or is having a separation issue.
For example my male had an awful separation problem and separation anxiety usually occurs with the first hour of leaving the dog. He would work himself up into such a frenzy when I'd leave (and he has his female sister for company) that he would rip things apart, pull things off the counter and make himself vomit, sometimes defecating. Never scold for this, they cannot help it.
He's needy mama boy and is much better and no longer does these things.