I am studying acidity of carboxylic acids and I found that benzoic Acid is more acidic than p-methoxybenzoic acid. It is written in my book that this happens because methoxy group is an electron donating group. I can understand why electron donating groups can reduce acidity of an carboxylic acid but I can't understand why methoxy group acts as an electron donating group?
The lone pair on the oxygen delocalizes into the conjugated aromatic ring.
Edit (based on Jan's suggestion):
Notice that the answer is actually a lot more complicated. A methoxy substituent actually impacts the ring electronics via two competing effects. The oxygen's lone pair is well-placed to delocalize and increase electron density within the ring's conjugated system. This allows delocalization to better stabilize positive charges. So the methoxy is electron-donating from a resonance perspective.
On the other hand, because oxygen is quite electronegative, the methoxy group is electron-withdrawing in an inductive sense via the $\sigma$ bonds.
Take a look at a linear free energy relationship (LFER) plot. For acidity of benzoic acids, the methoxy group has a positive $\sigma_{\mathrm{meta}}$ value but a negative $\sigma_{\mathrm{para}}$ value.
The meta $\sigma$ value measures the effect when there is no resonance structure that delocalizes effectively to the carboxylic acid, and its positive value tells us that the methoxy is electron-withdrawing in that position. The negative para $\sigma$ value tells us that when there is effective conjugation into the carboxylic acid, the methoxy is electron-donating. Notice that it is still electron-withdrawing inductively, but the resonance donation is much stronger.