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.
The other important reason that many cake and cookie recipes include baking soda is that the alkalinity increases both Maillard browning and caramelization. Failure to include sufficient amounts of baking soda may lead to having to choose between A) properly cooked, but pale and less flavorful baked goods or B) overcooked, but browned and "toasted" ones.