Rob Lowe as Chris Traeger, executive producer Michael Schur, Amy Poehler as Leslie Knope, and executive producer Dean Holland on the set of Parks and Recreation. Photo: Ben Cohen/NBC

Being a fan of Parks and Recreation over the past six years has meant loving a show that almost always seemed on the verge of cancellation. During the early seasons, journalists interviewing creator Michael Schur were pretty much required to bring up the show’s low ratings and ask him to gauge its odds of survival — so much so that Schur eventually began to paint life on the Nielsen bubble as a positive. “I’ve come to really enjoy the uncertainty. I think it breeds good ideas,” he told HitFix’s Alan Sepinwall in 2013. And yet, when Parks signs off tomorrow, it will have run seven seasons and 125 episodes: That’s a short run, perhaps, compared to other classic comedies (200 for The Office), but more than enough to avoid the dreaded label of “critically beloved but short-lived” (we will never let go, Happy Endings). So how did Parks manage to overcome low ratings and end its run on its own terms? Let’s do as Leslie Knope would, and make a list of all the pros that kept Pawnee thriving as long as it did.

1. Everything’s relative in TV.

There’s no getting around the fact that Parks’ audience has never been big, and despite intense love from critics and the internet, viewership (at least as measured by Nielsen) never took off. The show’s first run of six episodes back in the spring of 2009 averaged a modest 6.1 million viewers, less than half of that year’s No. 1 sitcom, Two and a Half Men (14.8 million). By season five, tune-in was down to 4.1 million viewers (and yes, that’s including DVR playback). Even among adults under 50, the demographic NBC generally cares most about, Parks never perked up. In fact, its numbers actually went the opposite way, falling from a 2.8 demo rating in season one to a 2.1 by 2013.

But networks don’t always make renewal decisions based on raw numbers. Parks never produced amazing ratings, but during its first few seasons, it often outperformed whatever show NBC put in front of it. It earned its very first renewal after it managed to do just a little better among young viewers than initial lead-in My Name Is Earl. When NBC paired it with Community the next fall, the two shows generally generated the same Nielsen numbers. Granted, those numbers kept NBC stuck deep in fourth place in the 8 p.m. hour. But they also happened to be better than the network’s biggest comedy gamble that season: the 10 p.m. Monday–Friday disaster known as The Jay Leno Show.

This trend continued throughout Parks’ lifespan, even when NBC made it clear it thought it could do better than the citizens of Pawnee. Season three, for example, was delayed after NBC decided that rather than keep Parks behind the still-mighty The Office, it would try newcomer Outsourced at 9:30 p.m. Thursdays in the fall of 2010. The freshman half-hour flopped with both critics and viewers, and when Parks returned to the schedule in January of 2011, it immediately improved on what Outsourced had been doing (and did about as well as other comedies that season, including 30 Rock and the short-lived Perfect Couples). The same scenario played out in season five: Even as Parks continued to lose viewers, NBC newcomers such as Whitney and Animal Practice were even more disappointing (and also not very good shows). Parks never had a big audience, but it was a loyal and relatively consistent one — and about the same size as most every other comedy the network aired during its run.

2. The viewers Parks had were the right kinds of viewers.

While NBC’s visit to Pawnee ultimately lasted as long as it did in part because the network never had anywhere better to go, Parks also benefited from living in a very attractive Nielsen neighborhood. The show’s audience was small, sure, but it was made up of two types of viewers particularly loved by Madison Avenue: young people, and those with lots of disposable income. During its third season, for example, Parks actually ranked among network TV’s top 20 scripted shows in viewers ages 18–34 that year, outdrawing the first season of ABC’s then-buzzy Revenge, CBS’s Survivor, and NBC’s Law & Order: SVU. Even as its small ratings grew smaller over the years, Parks kept its appeal with younger folks, ending last season with the youngest median age — 41.7 — of any prime-time program on ABC, CBS, or NBC. The show has also always done well with what network ratings wonks call “upscale” viewers: Last season, Parks’ audience boasted a higher concentration of adults ages 18–49 living in homes where the median income was over $100,000 than every network comedy, save one (Modern Family). These strengths might not have been enough to make Parks a rousing financial success for NBC, but they absolutely figured in the decision-making calculus every spring when Peacock execs weighed whether or not to pick up another season of the show.

3. Parks was wholly owned by NBC.

As much as ABC loves having Modern Family as part of its prime-time portfolio, that show only supplies a single, direct stream of revenue to the network — advertising money. The reason: It’s owned by Rupert Murdoch’s 20th Century Fox TV, and as such, ABC essentially leases the show for its prime-time lineup. By contrast, when a network produces a series via its in-house studio — the way ABC does with everything Shonda Rhimes touches — it has the ability to monetize that success in multiple ways, most notably by selling the streaming rights to Netflix or Amazon and by putting reruns on local TV stations and cable outlets via syndication. So it is not insignificant that Parks comes from NBC-owned Universal Television. The Peacock’s ownership stake in the show provided an extra incentive for NBC execs to keep the show going long enough to ensure there’d be enough episodes — between 80 and 100 — to reap the benefits of syndication and other revenue streams. Had Parks hailed from outside the NBC Universal empire, it would have been just a little bit easier for the NBC network to have cut its losses midway through the show’s run, when it became clear it wasn’t going to become a breakout hit.

4. NBC liked being in business with Amy Poehler.

This, admittedly, is just a hunch on our part rather than anything scientifically provable, and it’s likely the smallest contributing factor behind Parks’ survival. But TV land, like all of Hollywood, is a place built on schmooze and relationships. Network executives, despite their reputations as cold-hearted bean-counters looking to wring every last ounce of profit out of their programs, get invested in certain shows because of talent, both in front of and behind the camera. And even if Parks never popped, Poehler’s profile — already high from her years on Saturday Night Live — only grew during the show’s run. She published a successful memoir, co-hosted the Golden Globes for NBC three times, and generally established herself as an A-list comedy talent. Current NBC chief Robert Greenblatt, who arrived at the network in 2011, inherited Parks from a previous administration, and as such, didn’t have any personal investment in keeping the show going. But he has had reasons to stay on good terms with Poehler, from convincing her to return to the Globes to hoping that she will star in future NBC projects. The Peacock’s love for Poehler alone didn’t keep Parks alive, but it certainly didn’t hurt.

A previous version of this story said that Parks and Recreation will end tonight. It won’t end until tomorrow!