My guess is that a variety of methods are used, but interestingly, my location comes up on the street in front of my neighbor's house, which means it doesn't know anything about my router, but is using hers instead.
Several years ago, I lived in NYC. My apartment was on the 19th floor. All the buildings
on the neighboring blocks were mostly 25 stories or taller.
Can the location service determine which floor or how high you live?