Soy milk; fridge vs. shelf?
I'll use (cow) milk as an example, but the idea is the same for other products like juices and fake milks. 

In the case of milk, the milk you get in tetrapak cartons (shelf stable milk) is ultra-high temperature pasteurized (UHT). It is heated briefly (1 to 2 seconds) to over 135 C then cooled down very quickly to kill bacteria and spores and then filled into a sterile container (the entire system is designed to keep bad organisms out, so the result remains sterile). This gives a much longer shelf-life than fresh milk (but once opened, it should be refrigerated), on the order of months. In contrast, the usual method of pasteurizing milk (at least in the US (*); Europe does a lot more UHT) is pasteurized by heated to about 70-75C for 15-30 seconds, then chilled and packaged (and lasts on the order of days).

The flavor can be affected due to things like the Maillard reaction occurring. Also, the temperature can affect the uses of the milk for applications like cheese making affecting the proteins. 

(*) This is dependent on the type of milk you get; organic cartons in the US you find in the refrigerated section are often UHT pasteurized.