There are two initial main reasons for tantrums - tiredness and hunger. Toddlers have little enough self-control and if they're getting to a point where tiredness and hunger are kicking in then all bets are off in terms of behaviour. Sugar, sweets and additives can also have an impact on behaviour. Low levels of DHA (one of the omega 3 fatty acids) can also result in temper tantrums, sleep problems and behaviour problems.
After things like sleep and hunger are dealt with, we're into psychological desires for stimulation (this is why boredom can equal tantrums), recognition (because even angry attention is better than none) and structure (for instance just having to follow you around a shop feels structureless to a toddler). They may also behave badly to discharge big emotions - anger, frustration, jealousy, loss, disappointment. Helping them rather than punishing them can develop their higher brain functions so that they will develop the tools for regulating these feelings.
There are two kinds of tantrums - distress tantrums and Little Nero tantrums. Distress tantrums happen because the neural pathways between the lower and higher brain haven't developed yet and the emotional pain of one of the 'big' emotions mentioned above completely hijacks their thinking functions that enable them to understand and express speech. That's why trying to talk a toddler down out of a tantrum is a waste of time. He can't really hear you. But you can remain calm, reassure him, even if you're just sitting next to him saying 'I know, I know', remember that his distress is genuine and he's not just being naughty. Distraction is also a perfectly valid technique for pulling a toddler out of the path to a tantrum (though it won't work once they're really going).
Timeouts and ignoring a tantrum leave massive levels of cortisol washing around the brain and can lead to huge anger-management issues in adults (remember that next time you read about an episode of road-rage)
A Little Nero tantrum on the other hand, is about control and is usually in older children who understand manipulation techniques.
Hope this helps!