So I’m thinking along the lines of this (volume warning)
But my two year old just did the same thing while “helping” to feed the dogs. She spilled a few pieces, looked at the mess, and then dumped out the rest of the cup. She exclaimed, “I make a mess” then picked up the pieces, put them back in the cup, and successfully poured it into the dog’s bowl. What breaks in their brain where the task doesn’t go according to plan so they make an even bigger mess?
Funny, I can feel the feelings of this urge, as I read. (Disclaimer: I am not actually a toddler.)
I can’t dissect my feelings fully, but I think a large part is feeling the anticipation of shame/failure from the whole thing going wrong (e.g. the whole cup of dog food falling out) and as long as you haven’t completed the task, that threat stays there. Spilling a few pieces draws attention to that threat - presumably to warn yourself off it. Throwing the whole thing down gives a wonderful relief: there is no more threat, no more striving for what might not be; what’s done is done. But after that, with the stress gone and the relief come, you feel the clearness to start again.