I get asked this question a lot and, to most people’s frustration, I have to say it comes down to experience. A good DJ specializes in two things: song selection and timing. That skill is only learned by DJing an insane amount of hours in front of hundreds of different audiences, observing and understanding what works and, more importantly, what doesn’t.
Let’s pretend that we have a guitar string tuned to play a note called middle C, which has a frequency of 1 Hz. (In real life, middle C has a frequency of 261.626 Hz, so if you want to think in terms of actual frequencies, just multiply all the numbers in the following paragraphs by 261.626.)