Capacitors in a power supply serve multiple purposes. One of the main roles is to smooth out the voltage output by storing and releasing electrical energy when needed. Capacitors also help filter out noise and ripple from the power supply, ensuring a more stable and consistent voltage delivery to the electronic components being powered. Additionally, capacitors can provide a quick burst of energy when there is a sudden increase in power demand, helping to maintain the overall stability of the power supply output.