Why is there a preference to use the cumulative distribution function to characterise a random variable instead of the probability density function? Perhaps this is but a subtlety but I've noticed that in quite a few definitions in statistics and probability, definitions regarding the distribution of a variable or a sample of data choose to use the cumulative distribution function to characterise random variables as following a specific distribution as opposed to using the probability density function.

E.g with the Kolmogorov Smirnov test, we look at the difference between cdfs and not pdfs.

Is there a specific reason for this ?
Every random variable has a CDF. Not every random variable has a pdf (for instance, discrete or mixtures of discrete and continuous distributions). For instance, in the Kolmogorov-Smirnov test, you are comparing an empirical CDF, which is discrete, to a potentially continuous CDF. In addition, convergence in distribution is defined using CDFs.
A CDF behaves straightforwardly under transformation/substitution of variables while a PDF requires meddling with differential coefficients.