I'm mostly asking this open question to those among us who are well-versed in developmental psychology (I'm mostly thinking of children) . Although, failing the actual scientific research on the topic, I guess some testable hypotheses would be great too.
The only book I've ever read on this was Stella Baruk's L'âge du capitaine, which doesn't have an English translation as far as I can tell. But her hypotheses match what I've observed in giving some remedial math lessons to the friend of my neighbours.
His main problems were confusion and panic. The confusion was caused by never having made sense of math: to him this stuff was just a welter of numbers. Baruk talks about "mathematism", which occurs when shool children hear a problem statement like "a train moving at 50 miles per hour starts from Paris at 2pm, when does it arrive in Livarot, 100 miles away". Instead of seeing this as a relation between everyday concepts - time, distance, rates of change - that they are perfectly able to grasp, the thought "omg this is math" takes over: they know that they have to combine the numbers somehow. So they start adding and multiplying and subtracting - anything that looks, to them, as if they're doing math.
By the time they get to algebra this sense of panic and confusion has become permanent. Watching my pupil struggle with linear equations, it was clear that he had above all lost confidence in his own skills; he didn't know what he was doing, he knew he didn't know, all he could do was try to soldier on in the swamp, trying things in a more or less disorganized manner.
Working with linear equations isn't too hard if you have a mental compass, a sense of what's going on; for me it's the metaphor of a balance scale, two sides that I'm keeping the same, and physically moving things from one side to the other. The only thing that's even a little hard is the mechanics of moving terms around, like changing signs; so you practice a lot until the exercises become boring, that's how you know the mechanics are no longer a problem.
(Also, a "dirty little secret" that I stumbled on as a kid and that helped me stay at the top of my class for a long, long time without ever having to make much of an effort: you can usually check your results by keeping an eye on "extra-mathematical" aspects; for instance the answer to one exercise will follow the same pattern as the answers to all the other exercises; if you've been getting round numbers, then the right answer is probably also a round number; unless maybe it's the last exercise in the set, the one that gives the top student the extra point. If it's a trig exercise, the right answer is probably a multiple of 15 or even 30 degrees. These "facts" make no sense in terms of actual math; and it's even possible that learning them was harmful for me and one of the things that curtailed my later math learning. But for a while they made for smooth sailing.)