There are a couple of assumptions driving this result. For instance, all agents are assumed to have preferences and a budget such that their optimal bundle is interior. For example, budget constraints were people cannot afford food are ruled out. Likewise, situations, where someone does not like one of these goods or has very strong substitutions patterns between a pair of goods, are also ruled out. All preferences are assumed well-behaved (monotonic and strictly convex).
Secondly, the market is competitive, so all people face the same prices not only for tomatoes but also for airplanes, wages, etc. This almost never happens in reality, but in some cases, it is a good approximation. For example, when considering shopping for breakfast, the relative prices between cereal and yogurt and eggs roughly reflect the willingness for every person to substitute one good for another.
This is a striking result and I see it more of a theoretical benchmark whose main intuition is that prices contain a whole lot of information about how people are willing to substitute one good for another. When they don't, it is very interesting to understand why.