There were w dollars in Olivia's wallet. She collected x more dollars from an atm. After she visited a supermarket there were y dollars left. How much more money did she spend at the supermarket than she collected at the atm?
First, we know that:

w + x = y

That is, the amount of money in Olivia's wallet after she collected money from the ATM is equal to the amount of money she had in her wallet originally plus the amount of money she collected from the ATM. 

Now, we also know that after she visited the supermarket, she had y - a dollars left in her wallet, where a is the amount of money she spent at the supermarket. 

That is, we have:

y - a = w + x

We can solve this equation for a:

a = w + x - y

That is, the amount of money Olivia spent at the supermarket is equal to the amount of money she had in her wallet originally plus the amount of money she collected from the ATM minus the amount of money she had in her wallet after she visited the supermarket. 

Now we have everything we need to answer the question. The question is asking for the difference between the amount of money Olivia spent at the supermarket and the amount of money she collected from the ATM. This difference is:

a - x = (w + x - y) - x

Which is equal to: