When you live in a city or visit often, it's hard to notice how rapidly things are changing. NYC used to always have a whole lot of apartment buildings, averaging between 12 and 25 stories with a relatively small number of really tall ones. Even so by looking at the skyline one could usually know with confidence that most of the tallest buildings of 30 stories and up were office buildings, located in the two main office districts--downtown and midtown. Also, many large areas were mostly made up of much smaller residential buildings. In the last 15 years or so this has radically changed with a new emerging skyline in which both apartment and office buildings regularly top 40 stories.
Spotting the apartments is somewhat easy, since most of these new buildings have tall needle like forms or other tricks meant to maximize window space as opposed to office buildings in which large block floor plans are more desirable.
There are two main factors, the first being that Manhattan as basically the only urban area with a fully supported high capacity subway system and mostly unbroken street grid is just seeing a massive amount of demand.
Another factor is that city government in the Bloomberg era has made a concerted effort to maximize development and tax revenue per dollar of transit investment.
The sum total result is a city that is both increasingly anti car, pro pedestrian and pro growth at the same time. Similar things are happening in the outer boroughs, but the story there is more complex.