What are the assumptions behind calculating the market equilibrium from supply and demand curves? Imagine that there are 5 buyers (B1,...,B5) with maximum willingness to pay as follows:

B1 = $5
B2 = $4
B3 = $3
B4 = $2
B5 = $1


Imagine that there are 5 sellers (S1,...,S5) with minimum selling prices as follows:

S1 = $5
S2 = $4
S3 = $3
S4 = $2
S5 = $1


I now present two hypothetical situations:

SITUATION 1: Each buyer is matched to the seller with the corresponding price. 

In this case, the quantity traded = 5 units

SITUATION 2: Match B1 with S5, B2 with S4, B3 with S3, B4 with S2 and B5 with S1.

In this case, the quantity traded is equal to 3 units since the last two trades cannot happen.

DISCUSSION AND QUESTION 

Obviously, these are two extreme situations. However, it seems to highlight an interesting point, namely, what assumptions do we have to make about "reserve prices" of buyers and sellers, and the way they interact with each other, in order for us to be able to calculate the equilibrium point? In other words, there seems to be more than meets the eye with the idea of calculating the equilibrium point from the supply and demand curves alone.
Public information about prices--not necessarily about costs or willingness to pay--is indeed the key here. 

If S5 is willing to sell to B5 at $1, she must also be willing to sell to any other buyer at this price. Given the low price, there would be an over-demand for the unit sold by S5, and a resulting upward pressure on the price asked by S5. 

Similarly, if B1 is willing to pay S1 $5 for a unit, he must also be willing pay the same amount to the other sellers for one unit. Then Sellers with lower costs will rush to compete for B1's business, thereby creating a downward pressure on the amount bid by B1. 

The process settles when the market reaches equilibrium described by your second scenario, where three units are traded at $3/unit. 

In Vernon Smith's canonical market experiment (and countless replications thereafter) wherein buyers and sellers with varying values/costs trade in a double auction,  the equilibrium outcome predicted by theory, rather than the assortative matching outcome described in your situation 1, is observed. 

This is also related to the Law of One Price.