The power supply converts alternating current (AC) to direct current (DC) and provides stable DC current to components. It contains cooling fans, heat sinks, electromagnetic interference filters, input and output capacitors, and other circuitry. When choosing a power supply, consider its ratings and the power needs of the computer components.