I have a few recipes at home that call for adding both baking powder and sodium bicarbonate to flour in a cake. Given that the latter is the main ingredient to the former (along with some starch), what's the purpose of using a bit of both?
There are two reasons (that have also been discussed in many other questions)
Baking powder isn't just sodium bicarbonate + acid. It often also contains aluminum compounds that release gas when they are heated. That means they will make bubbles not just when the batter is mixed but also when it is baking.
Baking powder is ph neutral while baking soda is basic. Recipes will often include mostly baking powder with some soda to neutralize acidic ingredients.