comparison between Fourier transform and autocorrelation function
Signals can be classified in many ways, and one of them is according to their nature such as being deterministic or random (stochastic). When a signal is deterministic, its spectral content is given by the Fourier transform provided that the signal is absolutely (or square o.w.) integrable; i.e., its Fourier transform exists.

On the other hand when an signal is stochastic, then ideally by definition its Fourier transform does not exist. (a random signal will always have infinite energy as it cannot decay to zero when time goes to infinity because then it will not be random otherwise.)

Therefore for random signals, the Fourier transform will not exist and their spectral density cannot be computed that way. Nevertheless, for such signals an indirect description, based on an autocorrelation measure, can also be defined, whose advantage being that the Fourier transform of it may exist. Therefore the PSD of a random process is defined as the Fourier transform of its ACF.