I've done a bit of work on this myself [puts on mortar board].
Ahem, I am not sure at primary level, but educational studies done at senior school and university suggest it it something called 'self-efficacy'. That is, the deep-seated belief that it is what you do, day in, day out that really makes the difference.
Young people who believe that they are 'intelligent' and people who believe that they are 'not that academic' both tend to lack persistence at higher levels of study, unlike those who really believe that it is what you do that counts.
You can make that observation as complex as you like - pointing out that that belief is a compound of several things - like emotional resilience to risk or withstand failure, the ability to delay gratification, realistic and healthy self-esteem, self-discipline, encouragement at home, respectful relations with teachers and socio-economic factors like access to good teaching, adequate resources and relevant gender/ethnic/class role.
The current economic situation for young people is also really damaging because it matters that they can look to the future and think 'if I put the work in to get x qualification I stand to get y (job/income/home) in future which I really want'.
Or you can make it really, really simple and say those who don't achieve don't put enough hours or effort in because they don't really believe that it will make that much difference. So it is really, REALLY important to praise persistence and taking on board constructive criticism rather than 'getting it right', or, conversely making it impossible for young people to ever fail..
[Gets down from podium]