For one Star Trek isn’t fantasy in space which is honestly a lot more appealing to those of the nerdy persuasion.
Like, Star Wars has ships that can travel anywhere and basically instantly whereas there are actually in universe explanations for how that might work in Trek and you can’t just zoom home whenever you want - Star Trek Voyager is a whole show about a ship that can’t return home. There are also just way better characters in trek and enough variety that everyone has different favorites.
It’s also nice that many of the conflicts in trek are solved through logic, diplomacy, and smarts. Only in Star Trek Discovery and the Picard show does the franchise venture too far into “pew pew” territory.
At the end of the day Star Wars is like 10 movies and a handful of shows that don’t do much and Trek has that many movies plus like 700 episodes of content.
One last tidbit, most of trek actually flows really well into each other and I think is way more cohesive than Star Wars where each era of movies feels like a different universe.
I’ve watched Picard and discovery twice now and can safely say they’re very pew pew. The third season of Picard rocks, regardless. I still consider discovery to be the worst of all Star Trek shows. At the end of the day, I love all trek, but those two are not the highlights of the franchise.