Many of the current cooperative apartment buildings in New York City started out as rental buildings. Beginning in the late 1960's and peaking in the 1980's, landlords started to convert their buildings to cooperatives in order to raise cash. Current rental tenants were given right of first refusal to purchase their units at deeply discounted "insider" pricing.
Many tenants took advantage of the favorable pricing then quickly re-sold the units at market rates. The flip tax was designed as a fee to generate revenue for the building and was imposed on the sellers who were making the big profits. While the number of cooperative conversions has dropped, many long established co-ops still impose these fees on the sale of apartments. Some condominium buildings also charge this type of fee.