Baking powder and baking soda are the two leavening agents, which help the cake rise in the oven. To clarify, when you introduce your cake to the heat of the oven, the leavening agents react with other ingredients, and as a result, little air pockets form. After that, the batter bakes around the air pockets and holds its shape, making a firm, spongy cake. However, expired baking powder and soda definitely won’t help the cake to rise but assists it to sink in the middle for sure.
Similarly, too much leavening agent can cause your cake to uplift too high too quickly. That is to say; the gas from them builds up and leaves before the cake bakes through in the midsection causing the centre to collapse and makes your cake sink.