Simply put; open headphones sound better, but closed headphones offer isolation.
By isolation I mean in terms of both sound leaking out from the headphones, and sound leaking in.
Unless you need isolation you should consider open models. You can get closed headphones that sound as good as open models, but generally the closed model will cost more.
That’s not to say that all open headphones are better than all closed models either, there are duds in both teams, as well as some models that break the mould.
Open headphones sound more ‘natural’ than closed models. Generally an open model will have much better soundstage (the ‘width and depth’ of sound), more natural bass (tighter and faster) and better separation (how well individual sounds/instruments/details are defined).
Closed headphones on the other hand tend to have a more ‘boxed in’ sound to them (where it sounds like the music is coming from inside your head) and boomier, more resonant (slower) sounding bass. Often this leads to closed headphones sounding bassier, but if you listen closely it’s normally just because the bass is stopping and starting slower, and less accurately, than it would on an open model. This is why using the term “better” can be very subjective. You might consider slow, boomy overpowering bass to be “better” than well defined and clear bass
On the topic of isolation and leakage; this will depend on volume levels. Generally if you’re listening to open headphones at moderate volume levels people in the same room as you will be able to hear at least some of what you’re listening to. If you have your music loud, they’ll clearly be able to hear what you’re listening to. If people are going to be disturbed by this, you might want to consider closed.
Also, if the ambient volume levels around you are low, you shouldn’t be that disturbed by them with open headphones, however if you’re in a noisy environment (public transport, aircraft etc) then closed headphones may be a better choice as you might have to turn open headphones up to drown out background noise, and that’s potentially damaging to your ears.