Paco had w cookies. He gave x cookies to his friend and ate y cookies. How many more cookies did he eat than those he gave to his friend?
First, Paco had w cookies. 

Then, he gave x cookies to his friend. 

That means that he now has w - x cookies. 

Then, he ate y cookies, which means he now has w - x - y cookies. 

The question is asking how many more cookies he ate than those he gave to his friend. That is the same as asking how many fewer cookies he has now than he gave to his friend. 

So, the answer is x - (w - x - y), which is the same as y - (w - x).