What Happens To People That Own Apartments Or Condos, When The Apartment Building Needs To Be Structurally Repaired Or Rebuilt? Or Demolished?

Most If Not all Apartments are built with steel structures/beams, which usually last 100 years, but with applied pressure less. What happens when apartment structures need to be fixed like the steel base/ beams? Or what if the rest of the apartment building is just too old & messed up needs to be demolished. Or huge renovation to fix the building? Will the people living inside be accommodated with new apartments? Or can they still live in the apartments like nothing is happening?