(written from a Production point of view)
The National Broadcasting Company, now formally called NBC Universal Television or, simply, NBC, is a US television network, founded in 1939 (as part of the NBC radio network, founded in 1926), based in New York City's Rockefeller Center. As of May 2004, it became part of NBC Universal, formalizing the five decade long industry partnership it already had with Universal Studios.
Star Trek affiliation
By airing on 8 September 1966 the first season episode "The Man Trap", NBC has gained the distinction of becoming the very first US television network to air a Star Trek live-action production, introducing the phenomenon to the general US populace. However, NBC lost out on the world premiere to Canadian network CTV, which had aired the episode two days earlier.  Yet, by canceling the original Star Trek series less than three years later, it has also garnered NBC the enduring wrath of generations of "Trekkies".
The Original Series
In early May 1964 the network became acquainted with Star Trek when Herbert F. Solow (formerly a NBC executive before his tenure at Desilu) presented a thoroughly groomed, prepared and coached Gene Roddenberry and his Star Trek is... pitch at his very last-chance meeting with NBC executives Jerry Stanley and Grant Tinker, besides taking a very active part in the presentation himself, eventually resulting in success. Due to their previous dealings with Roddenberry on The Lieutenant, NBC was wary, but Solow had instructed Roddenberry to keep quiet when not required to speak (which, given Roddenberry's predilection to the contrary, was excruciating for him), and most notably to drop the in Star Trek-lore famed "Wagon Train To The Stars" line, Roddenberry had used on previous pitching occasions. It worked as, "(i)t was Herb's tenacity and Herb's presentation that sold the series.", as Stanley later conceded. While not a science fiction fan himself, Solow strongly believed in Roddenberry's format, which he considered a more adult counter balance to the somewhat juvenile Lost in Space series soon to be aired by CBS Television Network. (These Are the Voyages: TOS Season One, 1st ed, pp. 21-25, 28-32; Inside Star Trek: The Real Story, 1997, pp. 13-23)
In February 1965 the first pilot episode "The Cage" was shown to NBC executives and famously rejected as being "too cerebral". Essentially calling their bluff, Desilu executive Oscar Katz recalled, "[NBC] didn't like the type of story we told. I think they selected [this pilot] to test Desilu on the hardest kind of story to produce because of the reputation Desilu had. Then, when they saw it, they were satisfied that Desilu was able to produce quality material, but it was the wrong kind of episode to take around to advertising agencies and sell. It was too off the beaten path. I asked NBC, "Why are you turning this down?" and was told, "We can't sell it from this show, it's too atypical"." Subsequently, Katz pounded home the point to NBC, "I said, "But you guys picked this one. I gave you choices [Roddenberry's Star Trek is... pitch contained twenty-five story outlines]." NBC then conceded their bluff being called, as Katz clarified, "[Mort Werner] said, "I know we did and, because of that, we're going to give you an order for a second pilot." (Star Trek Creator: The Authorized Biography of Gene Roddenberry) Ordering a second television series pilot episode, was nothing short of writing television production history, as no such thing had ever been done before.
The original Star Trek aired on NBC from 1966 to 1969. On the occasion of its debut in the television season 1966-1967, NBC released an eight-page promotional information brochure, introducing the series to interested parties. The brochure was in its entirety reprinted in the 1996 reference book Inside Star Trek: The Real Story. The network attempted to cancel the series twice, in 1967 and in 1968, but renewed it for an additional season both years, due to letter-writing campaigns.
By late November 1966, when the first season production was nearing its end, studio and Roddenberry were led to believe that Star Trek was not doing well in the ratings by a chagrined NBC, and Roddenberry sensed the possibility of a cancellation in the air. He discussed the matter with Harlan Ellison (with whom he was still on good terms at that time) and together, both men decided upon a campaign to save Star Trek. Ellison organized "The Committee", an advisory group of the foremost science fiction writers of the time through which a letter-campaign was organized. Science fiction fans (general, not specifically Trekkies alone) started to write in, and a veritable contemporary who's who of science fiction made their favorable opinions known in numerous publications, chief amongst them, renowned author Isaac Asimov, with whom Roddenberry would strike up an enduring friendship, stemming from this period. On 9 March 1967, a NBC announcer broadcast over the closing titles of "The Devil in the Dark" that, "Star Trek will be back in the fall. And please don't write any more letters." Thus was born the myth in Star Trek-lore that a letter campaign had saved the series for the first time. Actually, NBC had already decided to continue with the series before the campaign had even gathered steam, and Herb Solow had always been doubtful that the letter campaign had anything to do with this. He was informed by his former NBC colleagues that the network was fully aware that the relatively modest campaign was organized and artificial, and was merely considered a nuisance as the network had a standing policy to answer each and every letter sent to them. Reassured by some of his former colleagues, sincerely or not, that NBC was proud to air Star Trek, Solow could not get his suspicion confirmed that the decision was inspired by NBC's holding company RCA, which was selling color television sets at the time and who had commissioned the A. C. Nielsen Company (the rating company) to investigate the popularity of these sets among the public. Star Trek was still one of the few full color television series being aired at the time. (Inside Star Trek: The Real Story, 1997, pp. 299-307) The networks policy of answering each and every letter however, was to come back in full force to bite them in the behind not too long afterwards.
Near the conclusion of the second season, cancellation was made definitive by NBC. However, and much to the dismay of NBC, it found itself subsequently and suddenly confronted with a public outcry in the form of the famed, massive letter campaign, complemented by a deluge of phone-ins and unusually large picket-lines at both the New York City headquarters, and the Burbank, California, location, the likes of which, no network or studio had ever been confronted with before (years later, it turned out that the cancellation was an East Coast decision, the West Coast actually wanted to continue with Star Trek). The ultimate saving of Star Trek constituted the by Gene Roddenberry secretly funded and coordinated letter-writing campaign, initiated by Bjo Trimble and her husband in late-1967 and early-1968, which succeeded in making a shell-shocked NBC buckle and to renew, albeit reluctantly, Star Trek for a third season. Ironically, the funding Roddenberry provided, was not even his own; He managed to claim the money as business expenses from Paramount Television. For decades, network and public were led to believe that it was a spontaneous action organized by Trekkies, but Robert Justman and Solow debunked the "spontaneous" nature of the campaign in their book Inside Star Trek: The Real Story.
The original series was first aired Thursday nights at 8:30, where it replaced the show Laredo. For its second season, it moved to Friday nights at the same time. After being renewed for the third season, NBC moved it into the 10pm timeslot in place of the recently canceled Actuality Specials. Originally, NBC had intimated to Roddenberry a new, more family-oriented timeslot of Monday or Tuesdays 7:30PM for the third season, and he threatened to pull out if the network did not do so. Roddenberry grossly overestimated his value as perceived by network and studio, and since he did not possess the political and diplomatic skills – nor would he ever have – to deal with upper network or studio echelons (Solow had always ran interference for Roddenberry and the network and studio, but the former had left the production by now), the network was only too happy to call his bluff. When the network finally doomed Star Trek to the "graveyard slot" of Fridays 10PM, Roddenberry, having stated at the time to a newspaper, "If the network wants to kill us, it couldn't make a better move" (Toledo Blade, 15 August 1968) and his bluff gone awry, felt that he had no choice but to recuse himself from the remainder of the series. (Inside Star Trek: The Real Story)
NBC canceled Star Trek definitely in February 1969.  Production on the series ceased in June of that year, leaving the entire production at US$4.7 million in debt. (Star Trek Creator: The Authorized Biography of Gene Roddenberry, p. 399)
Star Trek legacy
No Star Trek series has aired on the national NBC network since, yet several of the Star Trek films have made their network debut on NBC, including Star Trek VI: The Undiscovered Country (in 1994) and Star Trek: Insurrection (in 2001, although the initial premiere was pushed back several weeks due to the events of September 11, 2001. Hence, it finally premiered in 2002, to coincide with the theatrical release of Nemesis).
While reviled by Star Trek fandom ever since for its cancellation decision in 1969, NBC, ironically, to this date receives residual income from the airing in syndication of the Original Series, as the original contractual obligations stipulated that net profits had to be shared between the Desilu/Paramount Television – CBS Corporation after 2005 (26⅔%), Roddenberry's production company Norway Corporation – currently under Roddenberry Productions (26⅔%), Captain Kirk performer William Shatner (20%) and NBC (26⅔%). (NBC: America's Network, p. 220)
The Animated Series
Former Original Series writer D.C. Fontana reported in the fanzine Star-Borne of 22 June 1972 that, "Paramount...[is] enormously impressed by the quantity (and quality) of fan mail they continue to receive. The possibility seems to be slowly developing of a Star Trek feature movie for theatrical release, aimed at becoming the new Star Trek television pilot...on the network front, NBC still expresses great interest in doing Star Trek in some form. Both NBC and Paramount continue to receive a great deal of mail and have had to assign secretaries for the sole job of answering it." 
NBC's surprising complete turnaround (who had canceled the live-action precursor in 1969, purportedly for poor ratings performance) not only stemmed from the spectacular resurgence of the Original Series in syndication, but also from its own accounting department. Shortly before Fontana's report, NBC had replaced its old Nielsen rating system with a new and updated one. When they ran the original Original Series figures through their new system, mystified by the success in syndication of the series they had believed was a flop, they found out much to their surprise that it had not only reached full penetration into their most coveted target audience, the male population between 18 and 45, but also that the series had been one of the most successful series, the network had ever aired. The sickening realization hit upon the dismayed network executives, that they had slaughtered the goose that laid the golden eggs, something that every Star Trek fan at the time could have told them, and which they actually had done in the first place. Hurriedly approaching Roddenberry to see if the series could be revitalized, turned out to be unfeasible, as Paramount had only a few months earlier cleared out their warehouses from the vast majority of the remaining Star Trek production assets, they either being scrapped, given away or simply stolen. Recreating them, calculated at US$750,000, was deemed far too cost-prohibitive. It did however, lead to NBC commissioning the creation of Star Trek: The Animated Series. (Star Trek - Where No One Has Gone Before, pp. 51-52)
Even though they did not produce the new series themselves, Paramount Pictures, possessing all rights and title to the Star Trek brand, was legally the owner of the new property. The animated Star Trek aired on NBC from 1973 through 1974, with re-runs airing during 1975.
The Next Generation
In the fall of 1986, NBC had another chance to air an entirely new Star Trek television series, when Paramount's Television Group President John S. Pike approached then NBC President Brandon Tartikoff for Star Trek: The Next Generation, that was in development at the time. On that occasion Tartikoff declined, as interest in science fiction for television was at an all time low at the time (after The Next Generation started its run, it was for years the only new science fiction series being aired). While Tartikoff was yet to revise his stance on Star Trek, NBC missed out on one of the most successful science fiction productions in television history on this occasion. (William Shatner Presents: Chaos on the Bridge)
NBC executive staff involved with Star Trek
- Jerry Stanley – Vice-President of Program Development (1964-1969)
- Brandon Tartikoff – President of NBC Entertainment (1986)
- Grant Tinker -Vice-President of West Coast Programming (1964-1969)
- Mort Werner – President of Programming (1964-1969)
- Inside Star Trek: The Real Story, June 1996
- NBC: America's Network, August 2007
- These Are the Voyages: TOS Season One, Season Two and Season Three, August 2012-February 2015
- Star Trek and American Television, April 2014