The main thickening agent in both vanilla pudding from scratch and box mix pudding is cornstarch. The cornstarch binds to the proteins in the milk when heated, which thickens the whole mixture. Homemade pudding is extra thick and creamy compared to box mix because it has the addition of egg yolks, which not only add to the binding mentioned above but also add richness from the additional fat.