We argue that on electronic markets, competition between liquidity providers should reduce the spread until the execution cost using market orders matches that of limit orders. This implies a linear relation between the bid-ask spread and the average impact of market orders, in good agreement with our empirical observations. We then use this relation to justify a strong, and hitherto unnoticed, empirical correlation between the spread and the volatility per trade, with Rs exceeding 0.9. This suggests that the main determinant of the bid-ask spread is adverse selection, provided one considers the volatility per trade as a measure of the amount of ‘information’ included in prices at each transaction. Our methodology, which extends the work of Madhavan, Richardson & Roomans, allows us to compare meaningfully the spreads in different markets. We find that the spread is significantly larger on the nyse, a liquid market with specialists.