Baking powder is a leavening agent, while xanthan gum is a thickening agent. Some recipes require the use of both ingredients, but you can’t use one in exchange for the other.