Tartaric acid is added to neutralize the sodium carbonate formed on heating by the decomposition of Sodium hydrogen carbonate.
If it is not added, the cake would taste bitter due to the presence of sodium carbonate. When baking powder is heated or mixed in water, the following reaction takes place,
NaHCO3+H+⟶Sodiumsaltofacid+CO2+H2O
CO2 produced during the reaction causes the cake to rise to make them soft and spongy.