How do eggs get infected with salmonella?

From the chickens. Chickens are common carriers of salmonella in their stools and the disease can pass transovarily from an infected chicken to the outside of her egg shell, even if the egg is otherwise intact and healthy.