Read the following text and answer the question.

Source: kellycodetectors.com
Have you ever seen a man with a headset and a long pole at the ground? If so, he might use a metal detector. People use these devices to find metal.
Metal detectors make magnetic waves. These waves go through the ground and change when they hit metal. Then the device beeps. This sound lets the person with the machine know that metal is close.
The first metal detectors were giant and meant to help miners. Now they are light and cheap. They also work better. That is why people bring them to the beach. They can look for rings in the water or phones in the sand. Metal detectors help them find these things, but people find junk most of the time. Metal detectors also protect people. They help keep guns out of some places like airports, courtrooms, and schools. They are used by guards to detect dangerous weapons.
Adapted from: ereadingworksheets.com
Why do guards use a metal detector in some places?