When my brother asked How does No Man's Sky, this is how I explained it. Below there are two files. The first file is a small command, using Ruby, to print the numbers 1 through 10^4. The second file is the result of that command. Notice the difference in the size of the two files. The first file is 60 bytes in size, the second is 51000 bytes. That means the math used to produce the result is 850 times smaller than the result.
And that is how No Man's Sky ultimately works. The disc on the store at Gamestop or the bits downloaded through Steam or PSN do not include the entire catalogue of graphics assets that make up every piece of the universe that is presented in No Man's Sky. That disc would have to be larger than any portable storage capacity medium that exists today.
Instead, what is on that disc is the math to construct the universe. That disc doesn't store the numbers 10^4. No, the disc stores ruby -e '1.upto(10**4){|i|print"%05d#{i%10==0&&"\n"||""}"%i}'
.
And that is