I copy and paste this explanation that chemist Neutral from infopop posted.
"Any school girl knows that a catalyst by definition does not take part in the
chemical reaction. A catalyst enhances the reaction but is not "used" up in the reaction."
So far so good. What are the facts? We know that in the biodiesel making reaction we must put in a particular amount of NaOH to get the reaction to go close to completion, even with a new oil with virtually zero FFA. If the NaOH were just behaving as a true catalyst putting in half the NaOH would result in the reaction taking twice as long but still going just as far. Clearly this is not what happens.
The only possible explanation for what is observed is that the NaOH is doing at least two things: acting as a catalyst for the desired reaction and also acting as a reagent in another reaction. What can that other reaction be?
Let's look at the desired reaction first. The NaOH in methanol produces methoxide ions. The triglyceride is attacked by the plentiful methoxide ion which attaches to the carbon at the business end of the fatty acid chain. The electrons then rearrange and the glycerol portion falls off leaving the methoxyl group in place, thus producing the methyl ester. The methanol is consumed but the NaOH is not. This is a true catalytic reaction.
Now consider alternative reactions. If, and only if, water is present the following reaction can occur: the NaOH generates hydroxyl ions from the water which compete with the methoxide ions, so that occasionaly one succeedes in attaching to the end carbon. If this happens the glycerol will still fall off but, instead of the methyl ester being made, a free fatty acid will result. This immediately reacts with the NaOH present to form soap, and here's the rub - in doing so a molecule of water is formed, replacing the molecule which was consumed in making the hydroxyl ion. So we see that NaOH is consumed but the water is not. If you like the fine points of symantics you might say that the NaOH was acting as a catalyst for its own consumption. It is simpler to say that the NaOH is a reagent rather than a catalyst.
The important point to note here is that the water participates in the production of soap but is not consumed. It is therefore a catalyst in the unwanted side reaction. This shows the importance of having the oil reasonably dry if a high yield of ester is to be obtained and to minimize the amount of NaOH needed to drive the reaction close to completion. However even if the oil is bone dry the unwanted side reaction will still occur as water is produced when NaOH is dissolved in alcohol. The only way this can be prevented is by using sodium metal or sodium methoxide instead of NaOH, both expensive.