Generally, a network will cancel a TV show that does poorly in the ratings. If there are no viewers, then there’s no way to get enough ad revenue to continue airing it. The occasional prestige, critical darling sort of show aside, networks rarely cancel anything that is doing well.
That would be why it was a surprise to fans when the Sci-Fi Channel canceled Farscape after four seasons. At the time, the show was the network’s biggest hit. It was also the most expensive, and it showed on the screen.
It was also a gem of a space opera.