Pasteurisation (and refrigeration) is the reason milk now has a use-by date some 2–3 weeks after is has left the farm. Even when kept at less than 2°C raw milk will start to deteriorate immediately and has a life of 4–8 days because of the naturally occurring bacteria. UHT milk has been heated to a minimum of 138°C for 2 seconds. This destroys all bacteria in the milk, which is why is does not need to be refrigerated and has a shelf life of 9 months. It also denatures the proteins and caramelizes the natural sugar in milk called lactose, which is why it tastes awful.
Haddow, Nick. 2013. ‘Why Raw Milk Cheese Matters To Me’. Bruny Island Cheese Co..