Because no actually existing market is completely competitive. You are correct that in an academic sense, a completely competitive market would have 0 profit. But in reality, prices don't adjust instantaneously, and you can't just choose to buy groceries at a store in Vermont if your local one in Nebraska has higher prices.
Your average business owner is not aware of every price around the world, but the one price they do know is their cost basis. So they set the price somewhere above that and hope that enough people will buy (aka, they hope that demand is inelastic enough) that they will make profit>0 and not go out of business. This works because instead of infinite competition, most businesses will have only 2-3 competitors in their area. An easy way to visualize this is to think about the different gas stations around town; they probably have several slightly different prices for gas, but they all stay in business despite only one of them having the best price.
Because no actually existing market is completely competitive. You are correct that in an academic sense, a completely competitive market would have 0 profit. But in reality, prices don't adjust instantaneously, and you can't just choose to buy groceries at a store in Vermont if your local one in Nebraska has higher prices.
Your average business owner is not aware of every price around the world, but the one price they do know is their cost basis. So they set the price somewhere above that and hope that enough people will buy (aka, they hope that demand is inelastic enough) that they will make profit>0 and not go out of business. This works because instead of infinite competition, most businesses will have only 2-3 competitors in their area. An easy way to visualize this is to think about the different gas stations around town; they probably have several slightly different prices for gas, but they all stay in business despite only one of them having the best price.