Marx defines value, as the socially necessary labor needed to produce a commodity. To understand what value is we must first understand what socially necessary labor and a commodity are, furthermore how they interact to give us a true value of a given commodity.
A commodity that by which "a man must not only produce an article satisfying some social want, but also his labor itself must form part and parcel of the total sum of labor expended in society". (Marx, Capital Vol.1) This is stating that to produce a commodity a man must not only produce it because there is a demand but must also add in all other labor that went into producing the raw materials he is using to make the final commodity. All "the relative mass of labor" that is needed to make the materials, machines, buildings and tools that were originally used in the making of the raw materials that will eventually become the final commodity. (Marx, Capital Vol.1) .
Socially necessary labor can be said to be "the quantity of labor necessary for its production in a given state of society". (Marx, Capital Vol.1) Therefore the socially necessary labor time needed to produce something is dependant and changing given the state of society. The state of society includes the social conditions of production, a given social average of intensity, and average skill level of the worker. All these must be taken into account when calculating the socially necessary labor to produce a product. .
Now by knowing the socially necessary labor time to produce the commodity we can give it a value that reflects not only the market price but one in which takes in account the social labor that went into producing them. If we were to use the actual labor time needed to produce the commodity we would be forgetting all the labor time that was necessary to produce all products that went into making the commodity. Since different commodities use to a greater or lesser degree products from other industries the price would not necessarily reflect the value of the commodity.