Developers set the global price for their game. They can also set a unique price per store. All sales go through Steam, referral codes send a commission back to the store making the sale. For example, you're a developer with a game on Steam, $9.99, and you want to sell it on the Humble Store for a 24 hour sale, at $4.99. You set the Steam pricing coming from the Humble referral links at a 50% discount. Now, users browse the Humble Store, see the game at 50% off, click to buy, and get forwarded to Steam, or go through a Humble checkout that uses the Steam API. Valve takes the money, distributes a percent to the developer, and a commission to Humble. If Humble wants to send a part of their payment to charity, that's up to them.
Valve wants to encourage more user stores selling Steam games in the coming year. I imagine a new payment system will be announced in mid/late 2014 to accompany these changes.