Milk could contain Listeria and pathogenic bacteria. Throughout the production process, efforts are made to keep these contaminants at a low level my maintaining the temperature of the milk below 5°. At that temperature, the bacteria do not grow. Once the milk is delivered to the plant, pasteurization occurs at various stages to destroy all the pathogenic bacteria. These bacteria are destroyed by pasteurization, and this is why it is done.
A process equivalent to pasteurization occurs in the case of cheese made from raw milk during the aging process: the acidity changes, the water content is low and the bacteria do not have enough water to survive. So the effect is equivalent to the pasteurization process.