Here's a rundown.
FIFA have the rights to any and all World Cup matches. If they wanted to FIFA could broadcast every single World Cup match on FIFA.com, but that's not very smart because it doesn't make them any money (unless they charged), but it certainly wouldn't make it anywhere near as lucrative as selling it to the various TV stations around the world, but they leave that to the various football associations to sort out themselves. The FA get the best price for these tournaments over a few tournaments and tell FIFA "ok this is happening" and it goes on. So the TV stations (like BBC) pay the FA who pay FIFA.
Now as for the Champions League that's slightly different because the Clubs get TV appearence money because of the different deal in place.
In the case of Spanish football in England, Sky Sports broadcast that, but that involves Sky Sports negotiating directly with the Spanish FA.