Factors of production are inputs used to produce goods. Basic models of production have two input factors, labor and capital. In other contexts, additional factors such as land or entrepreneurship are considered.
In perfectly competitive markets, the factor price is equal to the marginal product of that factor, i.e. the amount of revenue gained by a small increase in quantity of factor used. So the price of labor, the real wage, is equal to the marginal product of labor, or the amount of output that an extra unit of labor will result in.
A profit maximizing firm will produce where the marginal product equals 0. If the marginal product is positive (greater than 0), the firm could increase output by employing more of the factor. If the marginal product is negative, the firm could increase output by employing comparatively less of the factor. When the marginal product equals 0, the firm cannot increase output by either increasing or decreasing output, so factors must be employed optimally.