TV Network Afflition Payments

Do the affilitates of a network pay the network (ABC, CBS etc) a fee to run network programs? Or does the network pay the local station to run their programs?

Networks usually compensate their affiliates to broadcast their programming. Although, due to the changing financial reality of broadcasting, many networks have been decreasing their payments, and there is talk about eliminating compensation entirely.