They get cannibalised.
I saw a wonderful example of cannibalisation some years ago in Lagos, Nigeria. The Nigerian Navy had bought some new helicopters from Westland to replace some Bolkows. One of these was sitting in the hangar covered in dust and missing various parts that had been "borrowed" to repair others. I believe the TTAF was in the region of seven hours!