Profit maximization in Perfect competition | Why is MC=MR at the profit maximizing level of output?

Why is MC=MR at the profit maximizing level of output? Perfect competition: In the market conditions of perfect competition, a price is fixed by the industry which has to be accepted by all firms. Any quantity of the commodity can be sold at this price. Hence the price remains constant.