This process is called blanching, and it's commonly done with vegetables to keep them crispy and bright green. Here, it shocks the green beans and keeps them from cooking more and getting soggy. Essentially it just stops the cooking process.