Oh god, I used to buy SO MANY Star Trek novels.
It's funny how it works. Star Wars novels were always like wretched fanfics (already discussed here). But early Star Trek novels (the ones I still might like a bit - haven't read any in over a decade) were almost criminally unrelated to Trek.
Basically, some struggling sci-fi writer would write an entirely original sci-fi story that they couldn't get published and just kind of let the Trek crew run into it a bit so that it nominally counted as a Star Trek novel. Sometimes they didn't even bother to maintain proper characterization, which made things even more bizarre. Some of the stories were bad, sure, but some were quite good. And quite a few of those writers went on to be recognizable names in Sci-Fi writing later on.
Towards the mid-and-early 90's, the books started to be more slavishly reflective of the main Trek canon (for what it's worth, no Trek novel is considered official canon on any level), but those early books were just hilariously weird sometimes.