Raw milk is nearly perfectly sterile when it comes out of a freshly cleaned teat. After that, virtually every microorganism wants to grow in it. The equipment must be handled and cleaned with precision and diligence. Any contamination provides a seed that will grow uncontrollably.
I test every batch of milk that I will consume, using both coliform and aerobic plates. This required a non-trivial investment in minor lab equipment, but it is the only way that I feel safe. The tests have caught mistakes that we did not even know we made, but they also give a high degree of confidence that the milk is pure.
In contrast, commercially pasteurized milk assumes that the milk is contaminated. As such, the regulations actually allow the tests that I run to show unsafe levels of pathogenic organisms. Sure, the heat kills them, but it does not remove them from the milk. All of their proteins are still there and will be consumed.
I used to get sick from drinking store bought milk, and I believe it was due to the literal shit that they allow to enter into the process.