(a) Baking powder is a mixture of baking soda and tartaric acid. When baking powder mixes with water, then sodium hydrogencarbonate reacts with tartaric acid to evolve carbon dioxide gas which gets trapped in the wet dough and bubbles out slowly making the cake soft and spongy.
(b) Substance X is tartaric acid. It can react with any sodium carbonate formed and neutralise it otherwise cakes and bread will taste bitter.