Ever wondered how your favorite late-night comedy show sifts through all of those ridiculous cable news clips to bring you the most ridiculous?

Much of the credit goes to editing bays full of caffeinated employees. But a technology called SnapStream makes their work easier.

Despite being a mere 14 years old, SnapStream is a must-have for hosts from Jon Stewart to Joel McHale. The Houston, Texas company’s client list includes “The Daily Show,” “The Soup,” “The Colbert Report” and “Last Week Tonight,” as well as broadcast networks.

SnapStream not only records hours of television, but searches for key words and phrases through closed captioning. Because the service for hearing-impaired viewers is federally mandated, companies like SnapStream can use it to track whatever shows need.

If Stewart and his writers need material on open-carry activists bringing firearms into restaurants, they can use SnapStream to find cable news reports with words and phrases like “guns,” and “Chipotle.”

The technology has become so helpful to staying on top of the national dialogue that every recent presidential campaign has subscribed, SnapStream President Aaron Thomspon told TheWrap.

Here’s how it works: A TV show, network, or campaign buys SnapStream servers and connects them to a TV feed. Clients can record whatever they want, strip out the closed captions and program guide information, and organize their finds into a library.

“The Colbert Report” has been using the technology since 2011. Before that it had to cross-reference transcripts with recordings of archived shows. Now there’s a smoother collaboration between the post-production department and writer’s room.

“The ability to quickly create montages with a wealth of video options has proven exponentially helpful in our mission to provide an accurate, comedic look at the news events of the day,” Scott Lawrie, the show’s footage producer told TheWrap.

“It has absolutely changed the way the produce,” senior producer Pat King told TheWrap. “There’s not a day that goes by that we don’t use it. … It’s cut our production time down by about 60 or 70 percent.”

It used to take 10 or 12 minutes to get a clip into an Avid editor. Now it’s much faster, which makes for a smoother process from writing to rewrites to rehearsal and air.

King’s favorite recent example of SnapStream enhancing a show was during the Cliven Bundy scandal. King and the staff had just returned from a break, and SnapStream allowed them to catch up fast.

But SnapStream is just as useful for competitive reasons as commercial ones. For example, a news show may monitor rivals for the words “Breaking News” so it can immediately jump on any stories it doesn’t have.

The technology started out as a consumer product, but has priced consumers out: It now starts at a one-time $10,000 hardware and software cost. A 15 percent annual support fee is not included. That’s for a low-end service allowing users to record four shows a once.

SnapStream has its competitors. Companies such as Volicon and Digital Nirvana log and monitor TV signals primarily for the quality control purposes of broadcast engineers. Critical Mention captures over-the-air TV and radio — 40 hours of video and audio every 60 seconds — in its many data centers. Finally, services such as TV Eyes allows its clients — including publications like TheWrap — to cull clips online.

But for comedy shows, which have notoriously tight turnaround schedules for their topical material — it’s SnapStream that gets the job done.

So, tonight, while laughing along to a late-night TV montage of ridiculous politicians, appreciate the humor, yes, but also take a moment to value the technology — the producers of the program certainly do.