This is an attempt at fully describing the pricing mechanism, but inevitably there is much more to be said about the system, and I plan to break this down even further in the future to discuss very fine points.
Everyone values something, in fact, everyone values multiple things. No one can know exactly how much anyone values anything except for themselves, and even then, there is no exact measurement for how much anyone values anything. Values are desired ends, however rational or irrational they are, and any achievement towards these ends has a benefit to the given individual. When a value has been fulfilled, even in part, other values become relatively more important to fulfill; this is the basis of the economic Law of Diminishing Marginal Return.
For example, I value good food, and my tastes define that Cheddar cheese is yummy, so if I were to obtain Cheddar cheese, I would be fulfilling some of that value, and consequently, other values would be more desirable for me to fulfill than obtaining (and of course, consuming,) good food. Perhaps after eating Cheddar cheese, I may value spending time with some good looking girls, who knows other than me, right? And who is to say any value is better or worse than any other value?
The above is valuation of benefit. Everyone has values, and everyone seeks to fulfill those values. As I stated above, any fulfillment, or any step towards fulfilling these values is of BENEFIT to the individual.
Now we will move on to another concept.
Scarcity exists, and it is a problem, because we just can't have everything we want. We don't have the means to overcome scarcity yet, if such an outcome is even possible. The problem is that any action requires giving up something else; said differently, there is a COST inherent in any action, and that cost can even be broken up into multiple kinds of costs.
Opportunity cost is what you give up for doing one action, or obtaining one good, over another. This includes the opportunity cost of your own time, and what else you could do with the resources you have.
Accounting cost is what it costs you in terms of "price." How much you have to pay in your own wealth in exchange for what you want. There is opportunity cost to accounting cost; what could have been done with the wealth spent. When analyzing a situation, one must be careful not to count cost twice.
I am about to introduce another "type" of cost, but it is rather unorthodox, so bear with me here...
Exertion cost is my own conceptual interpretation of what it takes for you to get what you want... you don't LIKE to dig things out of the ground, and it is hard work, but there is no other defined cost. What may be easier to think of this as, is that there is a negative valuation of doing labor. Some people so highly value NOT doing labor, that they will higher someone to do it for them. Now, this isn't an "official" division of what costs are, but I believe it provides a more complete concept regarding human action.
This above is valuation of costs.
I capitalized both COST and BENEFIT, because this is where ALL actions by any individual are derived from. In economics, there is a concept of marginal benefit vs marginal cost. The point is to maximize total "profit" in the sense that your benefit vs cost is maximized. The way people most efficiently achieve this maximization of "profit" is by making the benefit of just one more (a marginal unit, in case you are unfamiliar with the terminology,) equal to the cost of just one more. "Just one more" can be anything from "just one more minute working at a job," or "just one more bite of Cheddar cheese."
This last concept is valuation of actions... it is comparing costs and benefits to any action taken, including those involved in obtaining a given good.
Now, there are a lot more complexities within each concept as presented above, but I believe the outline as presented is sufficient to move forward to how personal valuations (the complete picture, valuation of benefit, valuation of cost, and the final valuation of actions,) affect social interaction.
People value goods. It isn't necessarily that they value having (or even hoarding) goods, rather, it is most often that they value what the goods do for them, either by producing more goods (capital goods,) or by consuming the good (consumable goods.) This isn't to say that people don't value holding goods without even utilizing them, as that is often what we call "savings," which is an investment in the future, and is often held as some form of EXCHANGE GOOD, something that is universally held as valuable, often for the simple fact that it is universally held as valuable.
Since people value goods (wealth, even, if you would like to exchange the terms,) for any given reason as a means to achieving their end valuation of benefit at the least amount of cost possible, it can be said that goods are DEMANDed. Since, as stated above, goods can either be used in the creation of more goods (capital goods,) or they can be consumed, it can be determined that all goods are for the end purpose of CONSUMPTION. (This is, of course, speaking of goods other than exchange goods.)
Now, as is rather obvious, you can't just take a piece of iron out of the ground and suddenly it is useful as a car... no, it takes more than just the physical labor of acquiring resources in order to make those resources valuable as a good. This requires that people PRODUCE something of value before the resources themselves are valuable as a consumable good.
Of course, no one can possibly make everything that they value as an end consumable good, there is no way to acquire that much wealth in capital goods, and that much knowledge as a producer to actually fulfill all of those end goals, and therefor specialization is needed to maximize derived value. Of course, whenever someone wants something that they don't have, they need to have something in exchange for what they do want. When the "thing" that is being exchange is the good, then that person exchanging is a SUPPLIER. When the "thing" being exchanged is some form of money, an exchange good, then we call this person the CONSUMER.
The above is the framework for the pricing mechanism... the important points that build our economic system, all before the actual interaction occurs, the pricing mechanism.
We have already shown that people work to fulfill their values, that this constitutes demand, and that the end goal grants benefit to intermediate actions towards that goal, as each intermediate action brings one closer to the end goal.
We have also shown that supply is the production of goods, that it is a method of providing the value that is demanded. Supply is always provided with a demand for something else in return, in today's economy, suppliers demand an exchange good so that they can then exchange that good for nearly any other good they'd like.
Because suppliers demand an exchange good, and consumers demand the supplier's good, an exchange occurs, IF the demanded amounts provide "profit," or benefit, for both suppliers and consumers. As already described above, individuals work to maximize profit, and profit is not necessarily defined by a monetary descriptor. This desire to maximize profits is coordinated through individual transactions priced by both parties; if a single party sets the only price they will provide something at, then the other party will display their valuation at that price, they will either buy it if they gain value from the transaction, or the will not if the transaction is too highly priced for their preferences. In order for the supplier to maximize their own profits, they must gauge this valuation of the consumer, to set their price at the point where the most value is derived for themselves, which also necessarily provides the most value across the number of consumers in the market. If there are multiple suppliers, consumers are more likely to buy a comparable product at a lower price; but higher quality might cost more, yet consumers may value that higher quality, and thus buy more from a higher quality supply.
The above paragraph alone is supply and demand... a mere portion of the pricing mechanism, as no doubt has been shown by the sheer size of this post. The entire pricing mechanism is defined by (at minimum) this entire framework as described above, and it all works during EVERY action that individuals take, so long as they involve other individuals. If other individuals are not involved, valuation still occurs. When I state this, remember that "price" is not necessarily defined by a monetary value, rather, it is the total benefit derived from an action, minus the total cost of engaging in that action.