Todd VanDerWerff in Vox writes Did your favorite TV show get canceled? Here are 7 reasons it might have. It's basically a primer on how network shows are funded. E.g., number three is "It struggled in the ratings and wasn't owned by the same corporation that owns the network". Shows are produced by one company and broadcast by another. Sometimes those companies are in the same family.
"For a good example of this, look no further than ABC's Marvel shows. Neither Agents of S.H.I.E.L.D. nor Agent Carter is a ratings powerhouse, but both help out ABC Studios and fellow corporate sibling Marvel. That money eventually comes back to Disney, the parent corporation of the network, the studio, and Marvel."
But then they give the example of The Mindy Project. NBC owns Mindy but it was broadcast on Fox. The ratings on Fox were low and since any syndication would go to NBC not Fox, Fox had little incentive to let it go on.