You buy it bagged at the store. Often comes in an over bag with two smaller bags of milk inside. Then you have a plastic container at home the bag sits in and you just snip the corner.
Big benefit is that you can freeze it easily. Where glass or containers would split when the milk expands the bag is durable enough to survive. So it was really great for very rural areas where grocery trips are something that only happened a few times a year.
Sweet and condensed canned milk and powdered milk served the same purpose but obviously didn’t taste the same.
When I was in elementary school in Northern New York (almost Canada) a long time ago, we had bagged milk pouches. Then I moved to PA in the 90s and haven’t seen them since except for bagged dispensers for coffee creamer in gas stations. Kinda odd…