Since I don't know how far you've gone in the series, spoilers for the most secret ending of birth by sleep final mix. After Aqua roams around in the realm of darkness, she finds a world she's visited, one that we know (from Kingdom Hearts 1) fell to darkness, and that world is Castle of Dreams. From this we can infer that worlds that fall to darkness simply move from the realm of light to the realm of darkness. If a person were unaware of the RoD and a world fell, to them it would stop existing, when it really just moved. So at the end of KH1, the worlds restore because the move to the RoL from the RoD (aside from the sleeping worlds, I couldn't explain them if I tried).