The material for memory foam was originally designed by NASA in the mid-1960s to improve the safety of aviation pads. It's made of a substance called viscoelastic polyurethane foam, which is both soft and shock-absorbing.
Memory foam works by shaping your body to cope with stress and heat so that your weight is evenly distributed - making sure your head and neck are aligned when you sleep. It provides good protection against impact, but at the same time is comfortable.