First, something I picked up from my early days when I spun more top 40 remixes than anything else: Genres are useful. When I started out I’d mix from hip-hop to house to electro to drum and bass - I just picked the song that I wanted to hear next. The problem was that it’s really hard to build a feel for a set that way. Even without such extreme variations, if you’re going from hard-hitting electro house to deep house and then back to electro, you’re probably going to lose your audience.
As for mixing in key - I’ll do it sometimes, but mostly I do so when practicing to train my ear for what’s in key and what’s not. Even without following the camelot key codes you can mix songs together well; you just have to learn to hear what sounds right together. I’ll listen to mixes now from my early days and hear obvious harmonic clashes that I thought were fine at the time - harmonic mixing helped me to realize that.
More importantly though, it’s about energy level. Most of the time I’ll try to gradually increase energy throughout my set. I mix mostly house (deep, prog, electro, tech, bit of techno etc.) so I’ll usually start slower and calmer - deep house, tech house, and more laid-back prog. As the mix progresses I’ll start bringing in more upbeat prog and lower energy electro. If you think about energy level on a scale of 1-10, (1-3 being ambient, 4-6 being chilled deep house/tech house, 7-8 being prog, 9-10 being ball-busting electro) I usually start around a 5 and I’ll generally move upward overall gradually throughout the night. I’ll still mix in lower energy stuff, just generally I won’t go from a 10 to a 6 - I’ll go from a 9 to an 8 to a 6, then gradually bring it back up again. None of this is a hard and fast rule, it’s just key to keep in mind that transitioning from a 10-6 or a 6-10 is going to be jarring to your listeners and you’d better know what you’re doing if you plan on doing so; done right they can make for refreshing changes of pace. Done wrong, they can feel like the DJ has no idea what he’s doing.
Oh, and energy level doesn’t necessarily correlate to tempo. I’ve heard 115 BPM moombahcore that’s easily twice the energy of 128 BPM electro.
On a basic level though, it comes down to “what do I think will work well here?” Sometimes the bassline in the track I’m listening to is similar to another track I know, so I’ll throw that on because I know the basslines will work well together. Other times, there’s similarity in the lyrics, or maybe a common synth, or same-length builds. Find connections between your tracks - find the track that seems like it, “should come next,” instead of," well, this’ll work," and you’ll be set.