If you thought watching TV was a waste of time, think again. Big media companies love you for it. Between Desperate Housewives, reruns of Seinfeld, and your local news, high-margin ad money is flooding into someone's coffers. But how can companies make money from the flashing box in your living room?

It's easier than you think. There are two main ways media companies turn your attention into gold: affiliate stations and national networks.

An affiliate station is a local channel, such as Detroit's WXYZ Channel 7, that is "affiliated" with a national network such as Disney's (NYSE:DIS) ABC. The station airs ABC's daytime, prime-time, and late-night programming, but produces its own daily news. ABC takes most of the revenues for ads that run during its programs; the local affiliate runs ads during the news and any remaining time slots. To fill these gaps, the affiliate buys syndicated programming from folks like Viacom's (NYSE:VIA) King World Productions, which licenses shows such as Oprah and Jeopardy!.

You can also cash in on television by running a network such as Disney's ESPN, Viacom's MTV, or News Corp.'s (NYSE:NWS) Fox News. Cable and satellite providers pay a fee for the privilege of carrying these networks, but most of the money comes from advertisements. The most profitable networks consistently attract viewers without paying too much for programming.

E.W. Scripps (NYSE:SSP), with 10 affiliate stations and five networks, uses both these methods to turn a profit. In 2004, Scripps' 10 affiliates had 342 million in revenues. More than 50% came from local ad revenue, 30% from national ads, and the remainder from political ads. Producing the news creates the greatest expense for these stations, with the purchase of syndicated programming a distant second.

Scripps' affiliate revenues are dwarfed, however, by those of the company's five fast-growing national networks. Scripps' networks posted revenue of $724 million last year, with the Food Network and HGTV accounting for 93% of total sales. Of its other three networks -- Fine Living, GAC, and DIY -- only DIY is turning a profit. Getting a foothold in this business isn't easy; the number of television networks has doubled since 1996.

Once established in their markets, however, networks and affiliate stations can rake in the advertising dollars. In its most recent quarter, Scripps' affiliate segment profit fell 6%, while network profit surged 30%. Affiliate profits were down because of the odd-numbered year -- less political campaigning meant fewer political ads. Meanwhile, HGTV and Food Network are consistently posting large gains.

Whether it's linking up with a giant like GE's (NYSE:GE) NBC or risking its own capital to start a network, a company has plenty of ways to make money from your valuable attention. So cheer up -- if you hadn't been watching Iron Chef reruns for the past few years, a company out there could be doing much worse.

Learn more about the TV business from this hit lineup:

Fool contributor Matt Thurmond owns no shares of any company mentioned in this article.