Gameplay wise I know you have to lock them all to get the secret ending, but Ive wondered since KH1 what locking a world does plotwise, the first time I locked a world I thought it was closing the barrier, which would stop the heartless getting through... right? Nope heartless still showed up, so Im confused as to what it actually means to lock a world.