Cooking generally reduces the acidity of lemons and limes. The heat breaks down citric acid, the primary acid in these fruits, making them taste less sour.
Lemons and limes owe their tartness to citric acid. When heat is applied, citric acid undergoes a chemical change. The heat energy causes the citric acid molecules to break down into other compounds, some of which are less acidic. This process effectively lowers the concentration of citric acid, resulting in a less sour or acidic flavor. The extent of the reduction depends on the temperature and duration of cooking. Longer cooking times and higher temperatures will lead to a more significant decrease in acidity. Other factors, such as the presence of other ingredients (like sugar), can also influence the perceived acidity.
If you want to retain some of the lemon or lime's acidity in a cooked dish, add the juice or zest towards the end of the cooking process. This minimizes the amount of time the citric acid is exposed to heat, preserving more of its sour flavor.