The way eggs get infected by Salmonella is the chicken itself gets infected with the bacteria Salmonella although the chicken never gets sick from the Salmonella.
When the chicken is infected with Salmonella the bacteria that causes Salmonella then enters the chickens Oviduct and Ovary where it then gets to the egg and infects the egg with Salmonella.
But the eggs that do get infected with Salmonella are rare and only a small number of eggs do get infected with Salmonella.
When the eggs are cooked and handled properly then the Salmonella should be killed and not harm you.
Be sure to cook all eggs thoroughly to kill off any bacteria that the egg may contain and if an egg looks bad then throw it out.