What does Hayek mean at the end of the first paragraph of The Use of Knowledge? I reproduce here the first paragraph of Hayek's well-known essay The Use of Knowledge in Society:


  What is the problem we wish to solve when we try to construct a rational economic order? On certain familiar assumptions the answer is simple enough. If we possess all the relevant information, if we can start out from a given system of preferences, and if we command complete knowledge of available means, the problem which remains is purely one of logic. That is, the answer to the question of what is the best use of the available means is implicit in our assumptions. The conditions which the solution of this optimum problem must satisfy have been fully worked out and can be stated best in mathematical form: put at their briefest, they are that the marginal rates of substitution between any two commodities or factors must be the same in all their different uses. [emphasis added]


I have bolded the part that I don't quite grasp, not being a trained economist. Can anyone explain this in layman's terms? (I understand marginalism quite well, so no need to go in depth on that, though it could help others understand better. Of course, perhaps I don't understand marginalism as well as I thought.)
Your marginal rate of substitution between (say) eggs and wine is the number of eggs you'd be willing to trade for one additional bottle of wine.  This marginal rate of substitution can reflect your preferences (if you're a consumer) or the state of technology (if you're a producer who can, for example, substitute three eggs for one wine in your production process).

Suppose your MRS is three eggs per wine and my MRS is two eggs per wine.  Then there's an opportunity for a mutually beneficial trade:  You give me two and a half eggs, and I'll give you a wine.  You thought the wine was worth three eggs, and you got it for two and a half --- that's a win.  I thought the wine was worth two eggs, and I sold it for two and a half --- that's also a win.

Whenever your MRS differs from my MRS, there's an opportunity for a mutually beneficial trade.  

Therefore, if our MRS's differ, it means that an opportunity for mutually beneficial trade has been missed.  

So in order for resources to be used efficiently --- that is, in such a way that all opportunities for mutually beneficial trade have been exploited --- the MRS between any two commodities must be the same for you as it is for me or anyone else, regardless of how we're using those resources.