Sometimes baking soda alone isn't enough to leaven a recipe, so baking powder is added (as with my chocolate chip cookies). In other instances when a recipe uses an acid for its flavor, you'll need both ingredients to maintain that flavor while also adding lift (baking soda alone would neutralize the acidity and you'd lose the flavor). And finally, sometimes baking soda is added to promote browning in a recipe that relies on baking powder for lift.