Carton is often used as outer packaging material or secondary package. It is hard enough to take the shape of rectangle, square, cylinder, octagon or pyramid.
It provides easy stacking option. Stack height depend on size and wall thickness. Bigger size and thicker walling allow higher stacking.
Carton is more presentable than laminated foil. I personally prefer a pack of Toblerone over Cadbury. It’s not about the taste difference. It is about the packaging difference. Toblerone box design is more elegant.
Carton cannot provide a barrier against oxygen, dust and microbes but provides a good protection against mechanical damage. A banana chips in polyethylene bag is likely to crumble during storage, transport and selling. Packing it in a carton box will provide better protection.
There are instances when a carton becomes the inner part of the whole package. Like this one:
The package contains four soft biscuits lined in a U-shaped carton tray. Carton benefits were ripped off but it can still provide the main function. That is to protect the soft biscuits from mechanical damage.
The technique works on certain degree but I think it is not as effective as the traditional. It is done to reduce packaging cost. The label is printed directly on laminated foil and the carton sized is reduced to more than half.