Working principle of proximity sensors

I want to know the main working principle of proximity sensors. There are different types of sensors available so all type of sensors work on same principle?

While reading this An Overview on Proximity Sensors - DERF Electronics I found that some proximity sensors are capable of detecting both metal and non-metal. Some restrict to one of either. But still unsure about their working principle.