Transformers only work on alternating current (a.c.). The current in the primary coil causes it to become an electromagnet. The continually changing current produces a continually changing magnetic field in an iron core.
Transformers only work for alternating current, because you need a changing magnetic field. The size of the induced voltage depends on the number of turns on each coil – if there are less in the secondary coil, the voltage falls, and if there are more in the secondary coil, the voltage rises.