The decision to munch on a cookie while watching tv at night instead of sipping on a protein shake after going for a jog is driven by your unconscious habits.
And those habits are controlled by the Basal Ganglia region of your brain.
For more info on your basal ganglia and all the how, why and what can I do about it….check out The Power of Habit by Charles Duhigg. It gets a little wordy at times, but it covers a lot of the science as well as offering a plan for modifying the habits you want to modify.
Instant Exercise Motivation