Supposedly Apple replace the upper case, keyboard, touchpad and batteries as a single disposible unit. Cheaper than replacing the whole laptop but not terribly good for the environment.
They replace the top case (with keyboard) when they replace the battery, but I highly doubt they just bin the whole thing. They can send the part for refurbishing, remove the battery, and reuse the top case.