Vinegar is acid, so it reacts to the shell of the eggs, which is made of calcium carbonate. This essential softens the shell (slightly) so the dye can penetrate it better.