Visual introduction on the concept of perfect competition. Tutorial includes discussion on profit, lost, marginal cost, average total cost and variable cost.

The fundamental assumption in perfectly competitive market is the condition on which consists of lots of buyers and lots of sellers.

A perfectly competitive market is one that obeys the following assumptions:
  1. There are a large number of firms, each producing the same homogeneous product.
  2. Each firm attempts to maximize profits.
  3. Each firm is a price taker: It assumes that its actions have no effect on market price.
  4. Prices are assumed to be known by all market participants information is perfect.
  5. Transactions are costless: Buyers and sellers incur no costs in making exchanges.
Suppose that there are changes in individual demand, these changes have no impact on market demand. Even if there is, it will be only on minor effect. Likewise on individual supply, any kind of changes will have no impact on market supply.

Equilibrium Price
An equilibrium price is one at which quantity   demanded is equal   to  quantity  supplied. At  such  a price,  neither   demanders   nor   suppliers have  an  incentive  to   alter   their   economic   decisions. Mathematically, an equilibrium price, P*, solves the equation:
<£D(P*, P', D = Qs(P*, v , w) 
or, more compactly ,
QS(P*)
The definition given in Equation above makes clear that an equilibrium price depends on the values of many exogenous factors, such as incomes or prices of other goods and of firms' inputs.  Changes in any of these   factors   will   likely   result   in   a   change   in   the   equilibrium  price  required  to equate quantity supplied to quantity demanded.

Profit Maximization
The assumption of profit maximization is frequently used in microeconomics because it predicts business behavior reasonably accurately and avoids unnecessary analytical complications. 
For smaller firms managed by their owners, profit is likely to dominate almost all decisions. 
In larger firms, however, managers who make day-to-day decisions usually have little contact with the owners.
In any case, firms that do not come close to maximizing profit are not likely to survive. 
Firms that do survive in competitive industries make long-run profit maximization one of their highest priorities.

References:

Microeconomic Theory: Basic Principles and Extensions 9e 
by Walter Nicholson

Microeconomics 7e, by Robert S. Pyndick and Daniel L. Rubenfield, Prentice Hall, 2009