Start with a switching circuit that supplies the DC with one polarity then reverses the polarity, back and forth. That’s done at the target AC frequency. An inverter that’s any good will knock the corners off the square wave and will further attempt to smooth the wave to more closely resemble normal AC power from the mains.