Principle of flyback operation:
1) Current goes through transformer primary.
2) Flux field builds however no current flows in the secondary due to the diode preventing it.
3) Current is shut off to the primary.
4) Flux field collapses, sending current through secondary in direction permitted by diode.
The neighboring circuitry is designed to cause On/Off switching at the proper times. Normally the output stage sends a feedback signal (via the optocoupler) so as to regulate duty cycle. The purpose is to regulate voltage at the load, although your schematic appears to lack a load.