In a perfectly competitive market, equilibrium occurs where supply equals demand, and in the long run, firms enter or exit until economic profits are zero.
The equilibrium price and quantity are determined by the intersection of the demand curve and the marginal cost curve, while the long-run equilibrium is characterized by zero economic profit, leading to price equaling the minimum average cost.