The flippant answer is “…because they look alike”, and they can be very alike.
Most of what you read about yellowlegs will tell you to look at bill length to distinguish the species. The bill of Greater Yellowlegs is actually longer (50 mm or more, compared to Lesser’s 40 mm or less) but birders deal with impressions of size, not absolute measurements, so we rely more on the fact that Greater’s bill is relatively longer (compared to the head).
This is very useful, and with a little practice virtually all yellowlegs can be identified correctly by bill proportions. An important point to understand, however, is that bill length is simply a “handle” or starting point that we grab onto as we take in the overall impression of size and shape. As we become more familiar with all aspects of the species, we can rely on body shape, movements, facial expression, leg length, and so on. These are more subtle, ephemeral, or subjective things, hard to put into words, but once we gain that level of familiarity these other clues supplement our judgment of bill length. We might still say we are identifying the species by bill length, but it’s really a combination of many subtle hints, and if we encounter a yellowlegs that doesn’t trigger a strong match on bill length, we subconsciously shift to rely more on other clues.
The truth is that there are yellowlegs with ambiguous bill lengths.
The point of this discussion is not to discourage you from using bill length as a field mark to identify yellowlegs. Most yellowlegs can be identified that way, but it’s always good to use some other field marks to confirm your impressions of bill length. Don’t be surprised to encounter a yellowlegs that is difficult to pin down on bill length alone. You can help prepare yourself for those cases by learning some of the other field marks, including voice, that can be used along with bill length to identify the species.