The main reason a television program is cancelled is a lack of viewers. A show can be cancelled if it is simply unpopular, but it may also be cancelled if downloads and recordings outnumber live viewings.
The most important demographic of television viewers are adults aged 18 to 49, because this demographic is most important to advertisers. Despite a decline in live TV viewing, television is still a hugely important aspect of the advertising business. Advertisers can't make money if people watch the programs online or use a DVR and fast-forward through the ads, so live viewers are an importance factor in a series' continuation.
Currently, television popularity is calculated according to Nielsen ratings. A show or series receives a rating expressed in points; the rating represents a percentage of the total population of a particular demographic. A rating of lower than 2 is a strong indication that the show is likely to be cancelled.
Networks can also generate revenue from licensing or retransmission fees earned when reruns of a show air on cable networks. A network is much more inclined to continue supporting a show that has a large, loyal viewer base and is likely to be rewatched after an initial airing.