Since the Discovery Channel first hit the airwaves 30 years ago with an after-school special on icebergs, the company has staged a surprising transformation to become the world’s king of reality TV, broadcasting a dozen networks with hits such as “Sex Sent Me to the ER” to 3 billion subscribers in 220 countries.

That shift toward guilty pleasures netted the media giant sky-high ratings and tons of advertiser cash. But by pivoting its lenses from snow leopards to naked survivalists and child beauty pageanteers, Discovery began to lose something, too: the prestige it had earned in educational, ­documentary-style TV.

Now, as cord-cutters and online video plunge the cable business into chaos, Discovery is fighting aggressively to return to its roots, spending millions on glossy documentaries, science shows and ­“environmental advocacy campaigns” in a bet that smarter, more-distinctive programming will help it survive the new age of TV.

But that gamble has led to fresh worries and an identity crisis for Discovery Communications, the Silver Spring, Md.-based owner of Animal Planet, TLC and some of TV’s most lampooned franchises: Can viewers turned off by years of reality junk food ever take Discovery seriously again?

“One day we just came in and looked at each other and said, ‘You know, no more bearded guys in the kitchen with f---ing pigs running through the living room,’ ” Discovery head David Zaslav, the highest-paid chief executive in the United States, said one recent afternoon in his eighth-floor office in Manhattan. “Let’s get back to who we really are. We’re about satisfying curiosity. Let’s forget about the ratings right now and let’s chase what the brand is at its best.”

HANDOUT PHOTO - A humpback whale breaches on the side of the Empire State Building as projected in "Racing Extinction." Photo provided by Discovery Communications. (Patrick MacLeod/Oceanic Preservation Society (OPS))

Discovery’s big bet highlights a key anxiety for America’s TV titans, who are increasingly losing the paying audience they counted on for decades to stay afloat. About 17 percent of U.S. households, or 21 million homes, have dropped (or never signed up for) cable, a cord-cutting wave that led investors this past summer to stage a $50 billion sell-off of media stocks.

Discovery has long benefited from cable’s bundle-centric business, in which the typical subscriber pays for 189 channels but watches only 17. With its guaranteed spot in the family living room, the $13 billion behemoth focused on rolling out franchises that channel-surfers couldn’t pass up, such as “19 Kids and Counting,” “Shark Week” and “River Monsters,” which in 2014 was broadcast into nearly 280 million households worldwide. Discovery also ran the three most-watched unscripted shows in 2015: “Gold Rush,” “Alaskan Bush People” and “Naked and Afraid XL.”

The networks within Discovery’s empire quickly grew into kingdoms of their own. Investigation Discovery, a true-crime channel, has become one of the most watched cable networks for American women, with grisly, rapid-fire shows such as “Nightmare Next Door” and “Wives with Knives” giving it the longest average viewing time of all TV, Nielsen data shows.

Discovery’s TLC brand — founded in the 1970s by the U.S. government as a free educational network, The Learning Channel — carved out its own profitable niche with syrupy “lifestyle” fare such as “Sister Wives,” “My Big Fat Fabulous Life” and “Here Comes Honey Boo Boo,” named for its Red Bull-chugging child “beauty queen.”

But that push toward tabloid-friendly TV also seemed to bleed into Discovery’s bedrock educational fare. The Discovery Channel was widely criticized in 2014 after airing “Eaten Alive,” in which a snake expert failed to get swallowed by an anaconda, and “Megalodon: The New Evidence,” which falsely suggested history’s largest “monster shark” was still alive.

Animal Planet, launched as a wildlife conservation channel, aired shows such as “Hillbilly Handfishin’ ” and documentary-style specials, with actors playing scientists, that suggested Bigfoot and mermaids were real. In 2012, after “Mermaids: The Body Found” netted the channel its strongest ratings in nearly six years, a network executive responded to a question of whether the “docudramas” were hurting Discovery’s prestige by saying, “The audience voted with their remotes.”

‘Lifestyle’ changes?

Now, with online video options such as Netflix flourishing and the average cable bill having ballooned to $92 a month, viewers have shown renewed interest in shelling out only for shows they think are worth the cost. And as much as people are glued to, say, shows about obese moms and bizarre addictions when they are on the tube, will they still opt to pay for them, or seek them out, when choices change — or move online?

“People view this kind of nonfiction ‘lifestyle’ content as something you put on in the background,” said Amy Yong, an analyst with Macquarie Capital. “It’s viewed passively as opposed to actively, like a nameplate hit.” In other words, she said, “You don’t need to watch it.”

To keep viewers paying, cable companies have begun offering “skinny bundles” with fewer channels and smaller price tags. But not all networks will survive in the new regime, leading investors to worry about a “death of the middle” for networks trapped between cable filler and must-see TV.

To distinguish itself, Discovery has doubled down on its old-school core of natural history, animal conservation and ad­ven­ture specials. The media giant tapped John Hoffman, an HBO veteran known for rigorous looks at American obesity and Alzheimer’s disease, to become its new boss of documentaries, with the mandate to ignore ratings and shoot for big talkers with award potential and strong reviews.

Hoffman’s first big move was picking up “Racing Extinction,” an eco-vigilante tale from the creators of the Oscar-winning documentary “The Cove” that mixes lushly shot explorations on the dangers of climate change with tense guerrilla stings inside the endangered-species black market.

The documentary, which will kick off a wave of science specials planned for 2016, is exactly what Zaslav wants people to connect to Discovery — not the other stuff. When meeting a reporter in New York, he showed off a glowing Rolling Stone piece — “How ‘Racing Extinction’ Could Save the World” — and grinned in the way one would expect a millionaire to grin after seeing his network’s showpiece anointed savior of the planet.

The ‘smart’ move

The risk, of course, is that Americans may not want nuanced conversations of topics such as animal conservation, whether they pay for cable or not. But Zaslav points to a few encouraging signs that viewers may be up to the task — the success of “The Martian,” the brainy blockbuster that made $225 million in U.S. theaters, and the headline-grabbing killing of Cecil the lion by an American dentist last summer in Zimbabwe. More programming tied to wildlife hunting and trafficking are in the works to draw off that outrage.

“The globe is in our DNA. That’s our burn, is the globe,” Zaslav said. “It doesn’t get closer to our heart than the idea of the safety of animals all around the world.” As for why viewers will tune in? “Smart is the new sexy,” he said.

The deeper problem, analysts said, may not be getting people to tune in for a few hours of “Racing Extinction.” It’s all those other hours — how to fill them with compelling shows that get the attention of viewers and advertisers.

“The reality is cord-cutting, cord-shaving, cord-never-ing is accelerating, and advertisers want to be part of live events, sports, that sort of programming. Regularly scheduled general entertainment doesn’t cut it,” said Rich Greenfield, a media analyst with BTIG Research. “The challenge is that ‘Racing Extinction’ is one show on one day. What is the must-watch live programming? What is the programing that makes them undroppable from the cable bundle?”

Discovery’s core moneymaker remains reality shows, and in that the company has a solid advantage over rival networks that rely heavily on scripted TV. The typical Discovery show costs $400,000 an hour to make, Zaslav said, while scripted shows, with their cinematic set pieces and ­Hollywood-caliber fashion, can cost $2 million to $4 million an hour.

But with about 409 original scripted series airing in 2015, twice as many as in 2009, networks and showrunners are pushing away from the saturated market and into Discovery’s cash crop of nonfiction TV. Netflix last month premiered its first original documentary series, “Making a Murderer,” to rave reviews. And Discovery Channel founder John Hendricks, who retired from the company’s board in 2014, unveiled his “Netflix for nonfiction” competitor, CuriosityStream, in 2015 for $3 to $10 a month.

That pressure to stay alive is real for Zaslav. Though the company’s stock fell 24 percent in 2014, “Zas,” as his friends call him, was paid $156 million — more than the chiefs of CBS, Comcast and Disney combined. Much of that money will come in stock awards he will pocket over the next six years, giving him millions of reasons to keep the company in high gear.

Don’t expect Discovery’s back-to-basics pledge to see much airtime on gleefully lowbrow channels such as TLC. “Long Island Medium,” whose host says she can commune with the dead, just launched its seventh season with a holiday special that the network said will include “readings focused solely on children.”

But TLC, the network argues, fills its own important niche. Zaslav, wearing blue suede shoes and sitting in a director’s chair in his airy corner office overlooking Midtown Manhattan, said the “misunderstood” TLC provides thoughtful storytelling designed for American families beyond the hoity-toity coastal elite.

“TLC is a very powerful and heartfelt Middle America brand. When we look at TLC, we basically say, ‘F--- New York and L.A.,’ ” Zaslav said. “Most of the media is not speaking to Middle America. So what are the shows we can put on [for a] 42-year-old mom who gives her husband and two kids dinner, and then puts the TV set on? What is she going to watch that she can relate to, that’s going to be entertaining and fun for her?”

“When people go to TLC to get nourished,” he added, “there’s a certain kind of content they’re looking for.”

Maybe that kind of guilty-pleasure TV is exactly what people will want, no matter where their shows come from. Laura Martin, an entertainment and Internet analyst with Needham & Co., said there will still be a place, even in the “lean forward” days of Internet video, for the “lean back” medium of good old-fashioned TV.

“For a large part, TV is wallpaper,” an always-on background for the American home, Martin said. “As the consumer goes through his day, does he always want to be lean-forward? Even young consumers want that downtime experience. They love their leisure time.”

That’s encouraging for a company selling TV you can turn your brain off to — even if it won’t exactly save the world. But Zaslav is insistent that the new Discovery is about more than just making easy-to-watch TV.

“There’s a lot of what we do with this company that’s not about making money,” Zaslav said. “It’s not for us to be distinctive. It’s for us to do what we were meant to do. This is a purpose-driven company. We want to do well, but we also want to do good.”