Key mixing or harmonic mixing is the art and science of creating a seamless transition from one song to another. This is only possible if the songs are playing at the same tempo, are playing in sync and are harmonically matched.
Beatmixing covers the tempo and playing in sync. Key mixing covers the harmonic matching.
“A commonly-known method of using harmonic mixing is to detect the root key of every music file in the DJ collection by using a piano. The root key that fits the track perfectly may be used to create harmonic mash-ups with other tracks in the same key” — Wikipedia
The above suggestion from Wikipedia recommends using a piano to work out the key of each song. This is the method I personally use and the reason we built Beats.
Once you’ve worked out the song’s key, a song of the same key or a relative key (subdominant or dominant key) can usually be mixed together. The relationships between keys are commonly called the Circle of Fifths or Camelot Wheel.
Finding a relative key is easy—move one block, either clockwise, counter-clockwise, from major to minor or from minor to major. Move one block per mix and one block only (no diagonals!).
Reading the Circle of Fifths is fairly easy, but using Beats to let you know which keys mix well is even easier. The same method also helps when using acapellas on top of instrumental records or producing mash-ups.
To be honest, you probably shouldn’t call yourself a DJ if you don’t at least understand what key mixing is, even if you don't try to mix everything in key.