Many people are accustomed to immediately placing freshly boiled or steamed eggs in cold water to cool them down and make them easier to peel. However, this practice is not scientifically sound, and it is best not to soak boiled eggs in cold water.
While immersing a cooked egg in cold water does cool it down quickly, and the difference in contraction between the inner shell membrane and the egg white membrane can create a gap that makes peeling easier, it overlooks the fact that cold water is teeming with bacteria. Once the egg is heated, the shell membrane that prevents bacteria from passing through is compromised. This renders the shell's pores ineffective as a barrier, allowing bacteria to easily invade the egg, giving them free passage.
The correct method is to add a small amount of salt to the water during the boiling process. The salt can kill bacteria and, similarly, cause a gap to form between the shell membrane and the egg white membrane due to their differing rates of contraction, making the shell much easier to peel.