The channel that allows sodium to pass through a membrane depends on the voltage difference across the membrane. When kept at resting, the channels are closed. Once the voltage level goes above the resting level, the membrane becomes depolarized and sodium can then start flowing through the membrane. The membrane repolarizes after the beginning of the action potential because potassium channels are voltage-gated just like sodium channels, but they are slower. So, when the membrane potential reaches threshold it takes longer for potassium channels to open.
Potassium rushes out of the cell when they open, causing repolarization.
Repolarization isn't as steep as depolarization because potassium channels open slower. After voltage gated sodium channels open to allow depolarization of the axon membrane voltage gated potassium channels open to repolarize it. The repolarization is less steep than the depolarization in part because the potassium channels are slower to open than the sodium. The repolarization is also less steep because even while potassium ions are rushing out some sodium is still leaking in as not all of the sodium channels close immediately.