This a a non-contact inductive proximity switch sensor. Which means that it induces current when metal is near to it. This sensor is used for positioning and detection of metal objects. The sensing range is depend on the type of metal being detected. Ferrous Metal, such as iron and steel, allow for a longer sensing range, while nonferrous metal objects such as aluminum, copper, can reduce the sensing range by 60 percent.
The output for this sensor is an open collector type. This means it is like a switch that connects the signal wire to ground (0V) when activated, and leaves it open circuit when not active. When you connect to a microcontroller to detect this changing you need to connect a pull-up resistor (1K-10K) between the signal wire and the power supply.