I can't see how they can be sure this is the same person. Unless Reddit is linked to some other site and when you log in there, Reddit knows because you gave them your email.
This is one of the reasons I hate Discord. I made an account ten years ago and forgot about it. In the meantime I built a new computer with completely new parts, fresh install of Windows. Then a few years later someone wanted me to join Discord and when I went to make an account, I was already signed in with this old account I'd forgotten about! It really freaked me out. The best I can figure is that gmail is linked to it so since I'm constantly logged in to gmail/YT, I was automatically signed in to Discord when I went back. I hate that creepy crap with a passion. Discord has some bad mojo voodoo going on.
Edit:
I just went back to Discord. First time in years. And it knows who I am! Oh god yuck.
Edit2:
It's definitely Gmail/YT. I just went there using Firefox and Discord doesn't know me.