Old dogs have a way of understanding how you're feeling, whether you're happy, sad or lonely. After so many years of observation, it shouldn't be surprising. When you've had a tough day, just having your dog around can brighten it.
Dogs are naturally empathetic and have the ability to sense your emotions. You may have found over years of togetherness that your dog will sit by you when you're subdued, and sometimes put his head on your lap. Who doesn't appreciate that?