Star Trek's treatment of computers really showcases society's attitudes towards these gadgets. Back when TOS was being made in the 60s, computers were very primitive affairs - the military and the space program were pushing for smaller computers, but a typical model would still be at least as big as a wardrobe if not a room. Still, they were just starting to get their first toe-holds in business. A lot of people were very worried about computers back then - it seemed that computers were threatening jobs (which indeed they were), and might even one day begin to replace Humans since they could "think" so quickly and accurately.
These fears were often played up in TOS. The Enterprise had "good" computers, of course, but we often saw "evil" computers - in "What Are Little Girls Made Of?" and "The Ultimate Computer" the threat was that computers would literally replace us, while in many other episodes computers were depicted as godlike beings exerting control over their biological minions. Rarely if ever did powerful computers contribute much that was positive. Even the godlike V'Ger didn't recognise "Carbon Units" as true lifeforms worthy of existence.
By the time TNG rolled around, computers were far more common. Half the population was using them at work or at home, and the internet explosion was on the horizon. They were less threatening to us - computer controlled mechanisation had destroyed jobs, but computers themselves had created whole new sections of the economy. So - after one or two early episodes like "The Arsenal of Freedom" - computers were somewhat more passive, more friendly affairs. Look what happened in "Emergence", when the main computer of the Enterprise-D "comes alive". In TOS the computer would surely have tried to kill all the crew, and probably a passing planet or two as well. But in TNG, all the computer wanted was to create a new child. The message is that computers can be people, too.
Of course this attitude is personified in the form of Data - the ultimate friendly, helpful, non-threatening computer. Data sums up the TNG attitude to computers more than any other element, and it is telling that a machine could become one of the most beloved characters in the show.
Voyager took all this to yet another level - with the EMH we are shown that as well as having a computer for a friend, we can even be pals with the software!
Where next for the computer in Trek? I have no idea. Perhaps some sort of internet-equivalent, a galactic super-information-highway. Watch this space...
Let me finish it:
But Then everything seemed to backpedal a Lot in Picard. Analysis of Data allowed the Federation to somehow replicate an army of androids... that they then used as slave labour. In particular, Slave Labour that apparently rebelled against being Slave Labour... and so the Federation banned robots as being 'too dangerous' Maybe just don't treat synthetic lifeforms badly? but this still got co-opted for the 'Oh noes the romulans did it even though said slave labour was being used to BUILD ships meant to HELP them because they couldn't stand the idea of ARTIFICIAL INTELLIGENCE and...' ... Oh dear, back to the 'AI is bad' stuff of TOS.