You get a sound based on what the device finds after you poke the
diamond with it.
Diamond testers check the heat conductivity of the
stone they are used on. Heat passing through a real
diamond happens differently than heat moving through glass or CZ. The rate is gauged by the tester, which then emits a sound that tells you what you need to know.
Diamond testers are obviously used a lot by jewelers to check if the
diamonds they handle are authentic. If you take a
stone to a jeweler, they are bound to first use a tester and see that the
stone is real. This also helps at times of repair, when the expert needs to be sure what forms of heat and pressure can be applied without damaging a studded
stone. Even customers can make sure they are not being duped by having the seller use a tester on their intended purchase.