Let's compare it to some other "unnecessary" thing, actual containers:
You can put stuff on ships without them, but turns out that once you start using them, just the fact that everything is standardized gives you insane benefits.
Of course you could reimplement each part of Docker differently. Of course it's not magic. Nothing is magic about a metal box, and yet that metal box completely revolutionized shipping.