Now it's basically a 50-50 chance of which transaction will make it into the ledger and which will be rejected as invalid because the input was already spent. If you have your own compute power, you can shift this, up to the extreme of having >50% of the total power, in which case you can guarantee B is accepted, since you can outmine any chain that includes A. However, there is no reason you would need to forfeit any reward if you personally mine the block with the transaction in it.
Confirmations shift the probabilities back towards the merchant, since no honest node will mine on a chain not already including A because the one including A is longer. In this case you must mine secretly on the chain including B until it exceeds the length of the chain including A. This absolutely requires more than 50% of the network compute power, since you must totally outmine the honest network. But again, if you can get the length of chain B up to the point where it exceeds chain A, the block rewards in chain B are yours and those in chain A are forfeit.
Which makes it fairly reasonable for a seller of $5-15 products that can be cancelled to take on that risk, since it's a lot less problematic and time-delayed than credit card chargebacks. "You'll gain high confidence within 10-40 minutes" seems preferable to "you might get a chargeback months later".
(Clarifying edit: I don't know if that's accurate for zero-confirmation double-spends; it's accurate for non-zero-confirmation double-spends.)