Children have an under-developed brain, which repeatedly takes them into fight-flight mode over issues that may seem small & trivial to us, but to their body & brain it is a big thing, equal to survival.
So when you don't buy that toy for your child in the mall, and your child starts throwing a fit, your child's brain is thinking that if he doesn't get that toy, he will die. At this point his brain will do anything it can, to get that toy. The brain is designed to keep our bodies alive at any cost.
In fact even when we are actually dying, the reason we recall all our memories from throughout our lives, is cause the brain is trying to find any information that we may have, which it can use to keep us alive.
So as smart as our brain is, it is still very primitive, and sees danger in things that are not actually dangerous, for e.g not getting that toy .
The way the child's brain perceives it is, that you are the tiger taking his equipment ,necessary for survival away from him.
So when the child is in fight / flight mode, he doesn't really know how to self-regulate, cos now the frontal lobe, which is the thinking part of the brain , of the child is off.
This situation is very difficult, cos even though our frontal lobes are completely formed, we also end up going into fight-flight mode, cos for our brains embarrassed in public is equal to danger. So our frontal lobes also go off, and both the child and us are operating in fight flight mode, leading to a disaster.
What we need to do instead, is regulate ourselves from going into that fight -flight mode. There are many steps that we can use to do this, but if we practice enough on this then we will be changing our neural pathways to respond differently the next time.
We shouldn't be expecting children to control their brains, cos they don't know how to, yet, but if they watch us doing this enough times, they will definitely learn how to.