1) extensive dewatering of the soil under the building and around it
2) some mistake in the calculations of the project and/or some foundation work made in difformity from the project
3) a combination of the two
IF it is only #1 (this is what the builders say) then stopping the water drainage or even (in certain case) re-watering appropriately the soil would stop the sinking (at a relatively low cost).
IF it is #2 or #3 it is certainly possible to "better" the soil underneath or "add" some (underground) supporting structures (at a much, much higher cost).
And of course someone will have to pay the bill.
Techically, IF the cause is #1, it is called "subsidence":
https://en.wikipedia.org/wiki/Subsidence
more specifically:
https://en.wikipedia.org/wiki/Groundwater-related_subsidence
Edit: P.S.: Seemingly the SF Millennium got just cited here also: https://en.wikipedia.org/wiki/List_of_leaning_towers
(maybe exaggerating a little bit, look for Santos, Brazil, strangely not listed in the wikipedia page)
No doubt determining liability will involve a lot of insurance negotiations along with various court cases. Maybe there's a code violation, but plans showing an inevitable violation were approved? Who is liable for that? Etc. There are many possible sources, even distributed sources, for a mistake like this. But central is determining the scope of the damage.