It comes from Faraday's law of indcution.
If a certain AC voltage with a certain number of turns causes a certain magnetic flux in the core, then in reverse, this same magnetic flux causes an equal AC voltage in equal number of turns.
In a transformer with two windings, the voltage applied to primary just generates the flux and that flux generates a voltage in the secondary. With equal number of turns, the voltages are equal. Assuming an ideal transformer with no resistive and magnetic losses.