Ratings play a huge part here. If not enough people watch a show, it doesn't attract enough advertisers. Without that cash, networks might decide it's not worth keeping the show on air. Sometimes, it's just a tough call based on what they think viewers want.