The Minecraft World generation works on a random seed number. By using this seed the software contains all of the world’s data. Once you enter a part of the world that has not yet been formed, it tests the seed of where it is supposed and then creates it.
This also applies to custom seeds you make yourself. The letters in the seeds are converted into some kind of number so that they can be measured in the formula. But often the formula changes (with each new update or roughly) and then sometimes placing a seed that would be perfect at 1.8 at 1.9 may not be that perfect, since the generation of the future would be different.
The number will generally be the date and time of the generation in the world.
From there you can get the start number (/seed) and use it to spawn the same world again when you put it on your Minecraft player or another Minecraft player of the same version, and it will work because all Minecraft players (of the same version) use the same formula for global generation.