Well, I'm no programmer but I'll try my best to explain it.
Actually "randomly generated" is not the correct term. The correct term is "procedurally generated." What that means basically is every planet in this game is rendered algorithmically as opposed to manually, which would be impossible considering there are 18 quintillion of them. Instead of Hello Games manually modeling and rendering 18 quintillion planets, they have developed an engine that does it automatically. So when you fly to a planet, the game engine will render that planet on the fly while you're there. Once you leave that planet, the engine completely discards it and renders the next planet you go to. Now, if you return to that planet again, it will be exactly the same as when you left it. The planet doesn't "re set" itself every time you visit it. It will remember how you left it. If other players fly to that planet, they will find it in exactly the same manner as the person who discovered it. Like if you discover a planet and do major terraforming like level mountains or create huge cavernous holes, or if you completely wipeout a species on a planet, the engine will remember that and whoever else flies to that planet will see those same changes that you made.
Now obviously, the engine will procedurally generate all planets using properties that Hello Games has put into it and according to them, those properties number in the thousands and thousands. Does that mean eventually there will be planets with similar properties with other planets? I'm sure it will considering how many planets there are. However Hello Games has said that 99% of the universe will go unexplored anyway because it's so massive.