This confused me for a second, but I finally figured it out.
Guy#1 pays $20, but gets $30 back by selling the box. Making a $10 profit.
Guy#2 pays $30 to get a box with $40 in it. Making a $10 profit.
HOWEVER, the original $20 Guy#2 put in to box isn't part of that last equation. He spent a total of $50 to get $40 in return.
Guy#1 gains $10, Guy#2 loses $10.
Still a nice trick if you can get someone to fall for it. When they buy the box, you should point out that they got their original $20 back. That might distract them enough to think it's legitimate.
P.S. I **** those fucking faces as well.