Seasons 1 and 2 were a mess for the writers. Gene Roddenberry was obsessed with what had happened to him on The Motion Picture (fired and replaced by different guys for the sequels), and he tried his best to make any significant voice in the writing room go silent, so Paramount wouldn't have anybody to replace him as a showrunner. So, he got rid of David Gerrold and Bob Justman, he sidelined D.C. Fontana, forced the writers to use Wesley (which was his middle name, he was definitely a Mary Sue).
At the same time, he was experiencing a series of mini-strokes that left him more and more exhausted. On TOS, he would rewrite an entire script overnight with a typewriter and a bottle of whisky. On TNG, he would push for more sexuality (Justice, from season 1, has every alien wearing some kind of toilet paper as a cloth, and his rewrites for The Outrageous Okona were all about depicting the character as the ultimate pussy magnet). This also resulted in him being unable to spend a lot of time on the set or in the writers room, and he was replaced in that capacity by his personal attorney, who had no experience with writing.
Meanwhile, he trusted writer Maurice Hurley to do things his way. Hurley sexually harassed Gates McFadden. As she wasn't willing to answer his offers, he explained that it was too complicated to handle a redhead actress because of the lightning on the show that made her hair curl, and that it was time to shuffle up things, hence her replacement by Pulaski. At least, there are a couple of decent episodes in season 2, like Measure of a Man or the introduction of the Borg.
Paramount ultimately managed to confront Roddenberry, forced him to stay on the backseat and appointed instead Rick Berman to take over at the start of season 3. Berman had apparently some kind of grudge against Wil Wheaton, but he was also clever enough to put together a good writing room headed by Michael Piller, who discovered a lot of beginners like Ron D. Moore, Brannon Braga, etc. Season 4 was as good as the one before, with a new director of photography who changed the lightning quite a bit, etc. They kept Troi's mother because her episodes were ratings hits. They brought older women to the show, and networks loved that.
And then, when we reach the final season, the writers were clearly getting out of ideas, hence dreck like the "Bev in Scotland with the ghost parasite that attacked all her female ancestors", "Sub Rosa", which was based on a spec script sent to them (they didn't see that it was also a ripoff from an Anne Rice novel, and they just regarded it as an update to The Turn of the Screw).
To be fair, they never really found how to write properly episodes around Troi, Bev Crusher or Tasha Yar. They tended to put them in situations were they were weak and exposed, plagued with doubts, rather than putting them in a more active position.
Also, Vash was brought to the show because Patrick Stewart had an affair with Jennifer Hetrick that actually cost him his marriage. They were then briefly engaged around "Qpid".