It turns out there are two different ways people respond to challenges. Some people see them as opportunities to perform - to demonstrate their talent or intellect. Others see them as opportunities to master - to improve their skill or knowledge.
Say you take a person with a performance orientation ("Paul") and a person with a mastery orientation ("Matt"). Give them each an easy puzzle, and they will both do well. Paul will complete it quickly and smile proudly at how well he performed. Matt will complete it quickly and be satisfied that he has mastered the skill involved.
Now give them each a difficult puzzle. Paul will jump in gamely, but it will soon become clear he cannot overcome it as impressively as he did the last one. The opportunity to show off has disappeared, and Paul will lose interest and give up. Matt, on the other hand, when stymied, will push harder. His early failure means there's still something to be learned here, and he will persevere until he does so and solves the puzzle.
If you're performance oriented, you'll do great on the easy stuff, but bomb out on anything that requires persistence over time to learn. Mastery motivation keeps you going on the tough stuff, and it's highly correlated with long term success in academics, profession, and personal life.
And it's as easy as how you praise: "You are so smart!" leads to performance and "You worked so hard!" leads to mastery. You can teach yourself to be mastery-motivated by focusing on learning how to do something that takes time, and praising yourself for that effort.
Hat tip Isegoria.