A transformer works by the process of mutual induction.
A time-varying current in a coil of wire will produce a time-varying magnetic field. That time-varying magnetic field will induce a voltage in a neighbouring coil of wire.
At the same time, the magnetic field will induce a voltage in the 1st coil of wire - this voltage will serve to oppose the supply voltage, and limit the current in the 1st (primary) coil.
If a current is drawn from the 2ndry coil, then it will produce a magnetic field which opposes the magnetic field generated by the 1ry coil. As a result, the voltage reflected into the primary is reduced, and the 1ry current can increase (as the supply voltage is less counteracted).
Quite how well this works depends on the inductance of the coils, and the degree of linkage (mutual inductance). This depends quite strongly on the strength of the magnetic field (or more precisely, the flux).
Magnetic flux, like electric current, can be thought of as flowing in a circuit (although there are no specific start/end pos/neg points, just a continuous loop). The same "magnetizing force" will produce a higher "magnetic flux" in a circuit with a higher magnetic permeability.
Iron has a very high magnetic permeability, so produces a high magnetic flux from a modest magnetomotive force. Air has a very low magnetic permeability, so any air in a "magnetic circuit" will greatly reduce the magnetic flux for the equivalent MMF (amps * turns). This property can be used to modify the properties of a transformer - for example, an arc welder may construct the iron core out of a "C" and an "I", the two parts are then mounted on an adjuster screw, so that they can be pulled apart or pushed together, allowing a small air-gap between them. The introduction of a tiny air-gap allows the overall magnetic permability of the core to be adjusted, changing the properties of the transformer (adding an air gap will result in have a current limiting effect).
If you try to make a transformer from just a rod, then it doesn't work very well, as the magnetic circuit has to complete the loop in air. The low permeability of air results in a small magnetic flux (relative to input current). Without a strong magnetic flux, you don't get good transfer of energy to the 2ndry coil when used as a "transformer".
A large air gap "transformer" can be useful, and is more usually called a flyback inductor. This used to be used for the generation of HV in CRT displays. However, it is widely used in cheap SMPS and as a HV pulse generator for vehicle spark ignition. In this setup, a DC current is applied to a coil on a low-permeability core. The current is allowed to ramp up (the inductance will slow the current ramp). As the current ramps, energy is stored in the core. The DC input is then shut off. The energy stored in the core's magnetic flux then has to go somewhere, and a voltage will be generated that will try to force the current through the coil in the same direction. This is "back EMF". This back EMF will be generated in ALL coils on the same core, and the pulse voltage is proportional to the number of turns. So, in a car ignition system, the primary side might have 100 turns, and the 2ndry 10,000 turns. When the ignition driver turns off, it might reflect 250 V back into the primary side, but because of the turns ration, the 2ndry will have 25 kV reflected into it.
The opposite turns ratio might be used for a phone charger - in order to assist with step down. By having electronics monitor the voltage reflected back into the primary, it is possible to determine the voltage on the 2ndry side (and therefore regulate the output voltage with feedback to the SMPS controller) without needing to electrically connect the input and output (for safety reasons).