Question: how do ds cartridges work?
Answer: It's saved on the cartridge, the first version of DS (Fat DS/DS Lite) doesn't have any sort of internal storage, so there is nowhere else for the saves to be. It's not until DSi that they started having internal storage. So yes, whereever the cartridge goes, the saves go with it.