What's that small hand-held machine, making a high pitched sound, that all dentists use on patients?

I have been to a number of dentists, and the moment I take the patient’s seat and the dentist asks me to open my mouth, out comes that hand-held machine and there’s this high-pitched sound it makes. It tastes metallic…? when it makes contact with my tongue/teeth. I don’t know if this is a good description of what I am trying to say. What is that machine, actually? And what does it really do?