It is not uncommon for rental buildings to be converted to condominiums or co-ops; in fact, most of the older buildings that are condominium or co-op developments started out as rentals.
Frequently the first sign that a building’s owner is considering a conversion is a series of improvements to the building—new windows, new kitchens and bathrooms, redecorated common space (corridors, lobby). The sponsor of the conversion (usually but not necessarily the owner) will contact all the tenants and give them the opportunity to purchase their own units, usually for a good price. If enough tenants decide to take the sponsor up on the offer, the conversion can go through. Although there is a fairly low minimum number, sponsors like to get as high a percentage of tenants to buy in as possible, because it means more money to pay for upkeep and keep maintenance fees down.