It doesn’t.
I googled “hardened pudding” to see if it’s a real thing. It mentioned two different kinds. One has gelatin added to the other ingredients that gives it a hardened consistency. The other is a pudding made with custard that has a hard caramelized layer to it. 😋