A general note to begin: Madrid is a rich club, in sound financial shape, with some considerable transfer money. Still, the competition for transfers among clubs is growing and there's no doubt that clubs like Monaco and Manchester City have access to far more capital at the moment because of their ownership structure.
Let's pick two examples of players we are being linked with. The increasingly complicated Gareth Bale transfer is being priced at between 80-100 million, while the much-desired (by Madrid fans) Isco would cost around 35 million. So there is some question about how Madrid will also pay for a striker to replace the want-away Gonzalo Higuain. His transfer money may only cover part of any potential deal with a new striker, and certainly wouldn't pay for Cavani. His release clause will be 63 million on June 30.
One solution is to sell players to make up any deficit. Another is to trade them.
Marca speculates today that Sami Khedira and Alvaro Morata could be part of the deal for Edinson Cavani. Or rather, that Napoli would like them to be. Adding a player to the deal drives down the cost.
In the case of Sami Khedira there's no question he's a player Madrid would probably consider selling under normal circumstances. Florentino Perez, while nowhere near as prone to buying players like a 10 year old with a play-station and a dazzling choice of attackers as he did in his first tenure (never you mind the defence!), still prefers his attackers to his defensive midfielders. But with only Luka Modric and Khedira himself available in that position in the fall from the current squad with Alonso out injured, selling or trading him seems unlikely. Madrid had 4 defensive midfielders last year and the team was horribly stretched. The club will have to add players to that position, not sell them.
There is also the problem that Napoli itself is not an attractive prospect for a player who probably has some options. There's a very recent history, for example, of players and players' wives being mugged in Italy's crime capital.
Morata is a more interesting case. His reputation is greatly enhanced by his tournament outing this summer with Spain's U21. But the player has said repeatedly he'd like to stay and has no problem being a substitute while fighting for a starting place, either.
It's likely speculation, and it would be surprising to see either player leave, but it does highlight a problem Madrid has in a very expensive transfer market.