The weather? War? Religion? WHY ARE YOU WASTING MY TIME WITH TRIVIAL TALK? I AM MAKING THE MOST IMPORTANT THING EVER OVER HERE!
My motivation is progress, most of the time. If I'm not making progress, I'll often switch to some easier task that I know I can get done quickly to get my brain in the right space and make 'getting into the zone' a downhill process.
Sometimes, switching back to whatever task was slowing me down is like going back uphill again, but I often find that I'll usually abandon the easy task because, while doing that, the harder task has been mentally solved (once you stop thinking about a problem, yadda yadda).
Of course, where I generally suffer is in getting all the easy tasks done. Solving a problem is fun. Writing a login page isn't, generally speaking. Making a 'reset your password' form isn't. So all those things often get left by the wayside, and I end up with an awesome project that is completely unsellable because the last 10% goes untouched while I work on something else.
A goal no one knows about is easy to quit without loss of face. But if all my friends know I'm doing something, I'm bloody well going to do it.
I always tell my friends I'm going to do something when it's something that really needs to get done. So far, whatever dopamine reward I get from talking about it has overpowered by the knowledge that I said I'd do it and it's not done yet.
As always, your experience may vary.