My son and daughter got given gifts where you place a plastic egg in water, and the (rubber?) toy inside expands (over three days) and breaks the shell of the egg so it 'hatches'.


I also observed that three weeks later the toys shrank again, but grew once placed in water.
I found the chemical reaction fascinating.
My question is: What is the reaction in a child's 'add water and watch the egg hatch' toy?