This relates to The Principle of Upthrust.
Upthrust is a force making an object to float. If the upthrust is equal or greater than the weight (mass x gravitational acceleration), the object will float. How to calculate upthrust?
Upthrust = volume of object x density of fluid x 10
You will see the density of fluid changes in your question. Adding salt (鹽) will increase the density of fluid, the upthrust increases in the case such that the egg is sink in water and float when salt is added in the water.