Flash memory is non-volatile, that means that it won't lose data when with-out power. It is strange how yours seems to wiping data though. What might be happening is the indexing files are being damaged/corrupt as the device powers off, that tells the iPod if a particular sectors of the memory has data on it or not, they would default to zero so think that nothing is there.
Its like loosing the catalogue to Argos and saying to yourself, "Argos must be empty!" A bad analogy but that is basically what I think it is doing.
Don't know how you would fix that, perhaps getting the battery replaced, a good strong and consistent voltage should possibly stop the index's from resetting.
Perhaps, but this is an odd one!
Hope this helps!