Esterification of a carboxylic acid and the production of water

In an esterification reaction between a carboxylic acid and an alcohol, a carboxylate ester and water is produced.

I found the following diagram online, and my textbook has a similar one as well

Question: In forming the water in an esterification of a carboxylic acid, why does the hydrogen ion come from the alcohol and the hydroxide come from the carboxylic acid and not the other way around?

I think it might be because carbon's bond to the OH- is weaker than the R bond to the H+ ion and requires less energy to remove those two ions from their respective compounds.

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.

It should first be noted that the circle drawn derives from experimental results. If you were to mark specific oxygens, e.g. by introducing radioactive $$\ce{^18O}$$ in place of normal $$\ce{^16O}$$, you can predict whether and where the ester product will contain $$\ce{^18O}$$ or not and whether the water will contain $$\ce{^18O}$$ or not.

\begin{align}\ce{R-CO-OH + HO{*}-R &<=>> R-CO-O{*}-R + H2O}\\[0.5em] \ce{R-CO{*}-O{*}H + HO-R &<=>> R-CO{*}-O-R + H2O{*}}\end{align}

Why this happens is due to the reaction mechanism. The mechanism’s first step is a nucleophilic attack of the alcohol oxygen to the $$\ce{C=O}$$ double bond to give a tetrahedral intermedate with $$\ce{O-}$$, $$\ce{OH}$$ and $$\ce{HOR+}$$ all bound to a single carbon. This breaks down by the $$\ce{C=O}$$ bond being formed and one group being expelled. If $$\ce{HOR+}$$ is expelled, the starting materials are regenerated. If $$\ce{OH-}$$ is expelled, then after proton transfer the ester product is generated.

Within this mechanism, there is never an attack on the alcoholic $$\ce{C-O}$$ bond so it cannot be broken. Furthermore, it is quite hard to break a $$\ce{C-O}$$ bond under displacement of $$\ce{OH-}$$ anyway. The only reason why it works in ester formation is that at the same time $$\ce{C=O}$$ is regenerated which provides the required energy.

Esterification involves ANDN mechanism which is basically attack of one nucleophile and the departure of another from the same molecule.here OR- group attack the carboxylic acid at the carbonyl carbon causing OH- group to leave. OH- will combine with the H+ ions present in the system to form water.