What does "shocking" food do? I've seen different recipes and some shows on TV that show a method of "shocking" the food; boiling it and then when ready, placing it in ice water.

What does this do for the food?
"Shocking" the food stops the cooking process, preventing the food from losing its color and texture.