Esterification of a carboxylic acid and the production of water
The mechanism of the reaction doesn't involve the direct exchange of ions in the way that, e.g., a metathesis/double replacement reaction might. Take a careful look at the reaction mechanism from the Wikipedia page. Notice that one of the intermediates (the product after step three) is a tetrahedral complex with two hydroxyl ($\ce{-OH}$) groups. One of those hydroxyls is indeed the original hydroxyl of the carboxylic acid moiety, but the other one is actually formed from the protonated oxygen of the carbonyl. Either one of them could, with equal likelihood, be protonated in a subsequent step to provide the water molecule that serves as a leaving group. In the image that you linked, it's convenient to circle those specific atoms, but that shouldn't lead you to believe that the mechanism of the reaction is in fact a simple exchange of ions.

The question that you didn't ask directly, but perhaps implied, is: why is protonation of the alcohol by the carboxylic acid, followed by nucleophilic attack by the carboxylate on the carbon of the protonated alcohol, not a viable mechanism? First, a protonated alcohol is more acidic than a carboxylic acid by six or seven orders of magnitude, which means that the initial proton transfer would be slow and unfavorable. Second, the resulting ester is apt to be hydrolyzed eventually (albeit slowly without catalysis, but then the whole reaction proceeds very slowly), yielding the original carboxylic acid and alcohol.