Why is milk in rectangular cans and soft drinks in cylindrical cans?

Basically, coke with its gaseous nature, exerts more pressure per volume than Milk and to balance it out, round shape fits it well for coke, because round bottles take the pressure evenly, while square bottles get the corners chipped due to uneven pressure.