The same topic comes up at least once a month.
1. Different people have different body proportions so two people of the same height might need quite differently sized bikes depending on the lengths of their legs, torso, arms, etc.
2. Manufacturers labels of “S”, “M”, “L”, etc. are pretty much worthless.
3. Reach is the horizontal distance from the BB axle to the center of the top of the headtube. This is the critical measurement when you are out of the saddle. If you run your bars a lot higher than this (with very high-rise bars or a riser stem, for example) the effective reach will be reduced. If you run the bars very low (flat bars and negative rise stem, for example) the effective reach will increase. You have to look at the overall geometry of the entire bike to be able to compare two bikes, a single number isn’t enough.
4. Ultimately, the only way to find a bike that fits you is to try different bikes and play around with stems and bars. There is a fair bit of personal preference involved too. I prefer slightly shorter bikes for agility in tighter trails. Other people seem to like really long bikes.