You are missing that the drive train design was entirely new when Model S was released and had some design problems that needed fixing, hence the free replacements.
That's exactly right. The whole drive unit can drop right out of the bottom of the car, so when there are any issues, Tesla will just replace the whole thing so that you don't have to wait for the unit to be repaired. They can then refurbish the broken drivetrain on their own time and then use it to replace someone else's failed unit in the future.