I think that, like anything, it’s a mix - and it depends what works for each individual property, and what the storytellers are trying to do.
I’ve always thought of Marvel and DC’s ongoing universes as being like soap-operas: endless sagas that don’t need to be experienced in full from beginning to end - you just jump on and enjoy the ride from whatever point you joined. And even when you narrow the focus to individual books, the same can be true: books like Spidey or X-Men are historically popular as much for the cast dynamic and soap-opera story elements as anything else.
That said, if the story that you want to tell is going to benefit from having a defined beginning, middle and end - and will be better served by not having links to existing properties - then that’s the way to go. Would Watchmen have been as effective if it had been a continuation or even re-imagining of the existing Charlton characters, as it was originally intended to be? Probably not. By standing alone and outside of the existing superhero universes, it managed to be both much more satisfying and complete unto itself, and make a powerful statement about the nature of superhero comics that wasn’t tainted by any association to an existing superhero universe.
Interestingly, it seems that some of the big franchises you mention - like Star Wars and Star Trek - have increasingly veered towards the open-ended approach in recent years (and decades), becoming less shackled by the limitations of the formats in which they were originally conceived. Star Wars is now to all intents and purposes open-ended in the movies, and is increasingly becoming an endlessly-expanding universe of infinite possibilities, especially when you consider the comics, TV series, novels, video games, etc.
And obviously the Marvel movies have drawn great strength from having each of their individual movies take place within a shared universe, with the MCU itself becoming a brand, and allowing overarching story lines to gradually develop across many different separate films.
Artistically, I think we will always have these different approaches, because they will suit the differing needs of different stories. There’s something inherently satisfying about a series that’s complete and finite, that you can hold in your hand in a single volume, that you can follow beginning to end. But a lot of benefits can obviously also derive from a single ongoing sprawling shared universe.
Commercially, I can definitely see things leaning towards the infinite connected universe exemplified by the Marvel and DC universes and the Star Wars mega-franchise, because you grab your audience and don’t let them go by giving them an easy jumping-off point.
Crucially, though, you have to be able to hook readers in with a strong story to start with, otherwise they’re not going to have any reason to invest in the universe as a whole. I think BvS is a cautionary tale about not taking that for granted: first, you have to start with a story that people like and make them want to see more, rather than assuming from the start that interest in a wider universe is guaranteed.