This chip is complicated, but the essence of your question is easily answered. The pin marked SW is a switch that closes the primary circuit to ground at the circuit's operating frequency, which is typically 10's of kHz to 100 kHz. This creates an AC current in the transformer primary that steps up in voltage to power the rest of the circuit. There is also a "charge pump" consisting of C1 and circuitry in the chip.