What I don't understand is why you are not allowed to air mail a battery by itself in a sealed container, while you are allowed to air mail the same battery inside a device. I am not that familiar with battery technology, but I would expect that a battery connected to a circuit to have additional ways of catching fire compared to a battery by itself. I mean if a fault happens inside the battery you are screwed whether it is in a device or by itself, but AFAIK there are cases where the problems were caused by the electronics connected to the battery, so you get an even higher chance of something going wrong. Maybe they are afraid the density, i.e. shipments with just batteries which would make more batteries per volume than say a shipment of laptops? But still, there would be rules about density then.
What am I missing?
Problem is battery density. If you're sending batteries, the amount is far more dangerous per unit volume than if the battery was in a device.
Shipping lithium batteries in bulk is what caused the downing of a UPS cargo plane a while back which is why they're no longer allowed - one battery caught fire, which then caused other batteries in the same container to catch as well.
Whereas if it was in a laptop, it may destroy the device and the pack, but the density of cells is lower and its less likely to catch more packs on fire.
It's why hoverboards are particularly dangerous - their packs of 10 or 20 cells wrapped tightly together - when one goes off, it will more than likely cause the rest to off as well.
Also, raw lithium and aluminum don't mix - which means the sprayed lithium can damage structural aircraft components as well.