So how can an inverter give us a high voltage alternating current from a low voltage direct current.
Let's first consider how an alternator produces an alternating current. In its simplest form, an alternator would have a coil of wire with a rotating magnet close to it. As one pole of the magnet approaches the coil, a current will be produced in the coil. This current will grow to a maximum as the magnet passes close to the coil, dying down as the magnetic pole moves further away. However when the opposite pole of the magnet approaches the coil, the current induced in the coil will flow in the opposite direction.
As this process is repeated by the continual rotation of the magnet, an alternating current is produced.