Styrofoam's low thermal conductivity is due to its cellular structure. Styrofoam is made up of tiny, closed-cell bubbles that are filled with air. Air is a poor conductor of heat, so the air pockets in Styrofoam help to prevent heat from transferring.
Cardboard, on the other hand, is made up of cellulose fibers. Cellulose fibers are good conductors of heat, so cardboard does not insulate as well as Styrofoam.
In addition to its lower thermal conductivity, Styrofoam is also more durable than cardboard. This means that it can withstand more wear and tear, making it a better choice for long-term use.
For all of these reasons, Styrofoam is a better insulator than cardboard.