Nitinol is a metal alloy, sometimes also called 'memory metal' or more properly Shape Memory Alloy (SMA). This memory effect was originally discovered in the 1930s, but Nitinol itself was only discovered in 1962.
Made from Nickel and Titanium, it was discovered at the Naval Ordnance Laboratory in White Oak, Maryland. Shape Memory Alloys have two distinct types of crystal structure, depending on whether they are above or below a certain critical transformation temperature. Below the critical temperature, the alloy is flexible and can be bent easily into any shape. This is known as the martensitic state, where the atoms are in flexible lattices, which allow the metal to be bent easily.
But once heated to the critical temperature, Nitinol shows its 'heat memory' as it tranforms into the autenitic state, where the atoms become locked into their previous rigid arrangement. When the metal springs into its remembered shape, it does so with so much force that it can be used to do actual work. Small motors have been built using Nitinol wire that passes through different temperatures. Solar panels on some satellites are raised into position by Shape Memory Alloys, activated by the heat of the sun.
A shape is programmed into a piece of Nitinol by annealing it. The metal is held in the desired shape, and heated to a high temperature. After it cools, you can bend it into any shape you want, but heat it above the critical temperature and it will instantly return to the high temperature shape that you programmed into it.
Here, the petals of the flower are made of Nitinol, and as they are heated, the petals unfurl, and the flower opens. Take away the source of heat and the petals quickly cool down, and the flower closes again.