Intuitively, we can relate to this: as we get closer to completing a goal we can feel more motivation to complete it. Getting close to the last piece of a puzzle, the last clue of a murder mystery or escape room, the final chapter of your book (perhaps), the final kilometre of a marathon, or as you find you need just one more stamp to get a free coffee, being so close to our goal can give us a motivation lift to get to the end. It has a name: the goal-gradient effect*.
In the example in the sketch, Oleg Urminksy and coauthors found that as people approached the final stamp towards a free coffee they were more likely to pick up the rate of buying coffees. And when issued with the new card, the coffee buying rate went back down again. They also found that it wasn't so much the absolute 'distance' from a goal, but the perception of distance. So, people who started out on a 12 stamp card with 2 stamps already complete tended to complete the card faster than the people who had a 10 stamp card starting empty even though it was the same number of stamps to the goal.
Read more in Katy Milkman and Kassie Brabaw's Scientific American article, Why Feeling Close to the Finish Line Makes You Push Harder.
Katy Milkman also educated me about the fresh start effect.
*The goal-gradient effect is also known as the goal-gradient hypothesis