A hard popcorn shell traps steam until hot starch breaks through, forms a temporary leg and flips the kernel. The pop is released vapour, not the shell cracking.
The tear-inducing molecule is assembled when cutting ruptures separate compartments inside onion cells. Your eyes are reacting to newly made chemical defence.