It's very different to say 'if not' and 'but'. In the first case, it is used as a condition, a conditional, as can be: "If you don't eat all the food, there is no dessert". In the second case, it is generally used to explain something contrary/different to what was said: "It was not chicken, as I had led you to believe, but it was fish"