What's Going On?
Calcium carbonate (CaCO2), the compound that eggshells are made of, reacts with acids to form carbon dioxide (CO2), water (H2O), and calcium ions (dissolved calcium atoms, with a net positive charge). In fact, it's because of this that calcium carbonate is the main ingredient in many stomach medicines: when your stomach is hurting, calcium carbonate can help neutralize some of your stomach acid and bring your stomach's PH, or level of acidity, back to a comfortable level. When we submerge the egg in vinegar, a weak acid, the eggshell "dissolves" into carbon dioxide bubbles, water, and calcium ions.
Now, an entire chicken egg won't just completely dissolve in vinegar. Chicken eggs are made up of several layers, starting with the eggshell and ending with the yolk. Between these layers, there are several others, including two thin membranes, as well as the egg white. The two membranes are covered in tiny holes, sort of like a strainer or sieve, and are responsible for deciding what's allowed in and out of the egg. Small molecules like water (H2O) can easily pass in and out through the holes, while larger molecules, such as proteins, can't fit.
Due to a process known as diffusion, particles generally like to move from high concentrations to lower concentrations. In other words, particles like to spread out as much as possible. However, when diffusion occurs through a semi-permeable membrane, these particles are too big to pass through the membrane and spread out. Instead, the solvent, or substance that has dissolved the particles (known as solute), moves through the membrane to the side with the greater concentration of solute particles, to try to spread them out that way. This process is known as osmosis.
After dissolving the eggshell, placing the egg in water allows us to observe osmosis in action. The insides of the egg, which contains various different substances such as proteins, carbohydrates, and fats, have a much higher concentration of dissolved molecules than the purified water. If it didn't, your water wouldn't be very pure! When we place the egg in water, because the molecules in the egg can't pass through the egg's membranes, the water molecules travel into the egg in an attempt to equalize the concentrations inside and outside the membranes.