The theory of the firm attempts to explain how firms behave under different market conditions. A firm is an organization that produces and sells goods and services to make a profit. Examples include companies, partnerships, and corporations. The goal of profit maximization is the short-run or long-run process by which a firm determines price and output levels to earn the greatest profit. This is achieved by setting marginal revenue equal to marginal cost.