Price discrimination can only occur when there is imperfect competition. This is because price discrimination involves a seller charging different prices for the same product or service to different customers based on their willingness to pay. In a perfect competition market, there are many buyers and sellers, and each seller sells an identical product, making it impossible to charge different prices to different customers. However, in an imperfect competition market, there are a limited number of sellers and buyers, and the seller has some market power, which allows them to charge different prices to different customers.