Salt added to water in a cup makes an egg float because the saltwater's density is greater than the egg's density. Density is a substance's mass divided by its volume. When sufficient salt is added to tap water, the mass of the salt-water solution increases, but the volume remains the same.
The salt water solution's density is greater than that of plain tap water. This causes the egg to float. However, if the egg is placed in tap water, then it will sink to the bottom because its density is greater than the tap water's density. In physics, this phenomenon of an object floating in a substance is called buoyancy.
In an experiment to demonstrate density and buoyancy, it is also important to figure out how much salt will cause the egg to float. Most experiments will use different concentrations of salt in water to find this piece of information.