The function of packaging could be a variety of things like preservation, aesthetic, function, or to keep things pristine. It could also be to tell a joke, give directions, let you know where exactly your cows milk came from, or to simply make things feel new.
Some things do not need packaging, like a car, but other things like a brand new Apple Macbook Pro gets you a sturdy premium white box with plastic wrapped over the surfaces, stickers, accessories, and the manual. In reality, the only things you use from the whole packaging shebang is just the Macbook and the charging accessories.
Through an environmental lens the extra stuff has to go, but the emotional brand impact that packaging brings with the Macbook overrides any urge to remove it.