Inductive proximity sensor--how does it work?
I have this device: QS18-05N-1 Proximity Switch.
I use it to detect the presence/absence of a steel ball, as shown at 53s in this video. Note that the ball is not magnetized.
I have two questions:
1. How does it work? I'd love someone to explain like I'm 5.
2. Does anyone know of a similar device that's shorter (in the vertical direction when oriented as in the video)?
I'm primarily interested in question 2 but I figure I should also try to learn something!

Comments
There's a link to the datasheet right on the sales page. In that datasheet you'll find a circuit diagram -- I clipped and edited.
That device is NPN/Open-Collector. What this means is that pin 4 (black wire) is either floating (like an open switch) or connected to ground. If you want to monitor that with a microcontroller like the Propeller, connect a pull-up (e.g., 10kl) to pin 4 and the other side to 3.3v. When the sensor is idle, the Propeller input pin will see a high; when the sensor is active, that pin will go low. Easy peasy. Note that the sensor is powered by 12v, and the ground on the sensor and the microcontroller must be connected together for this to work.
https://www.balluff.com/en-us/blog/the-basic-operating-principle-of-an-inductive-proximity-sensor
https://www.baumer.com/int/en/service-support/function-principle/working-principle-and-technology-of-inductive-sensors/a/Know-how_Function_Inductive-sensors
"... creating an alternating electromagnetic field that emerges from the active surface of the sensor. Any metal object approaching the front will induce eddy currents draining energy from the oscillator."
As for size and shape, it looks like you've got it sitting sweet as is. I wouldn't change what you've got.
Here's a Q&A along the lines of Jon's answer - https://www.ifm.com/gb/en/gb/landing-page-uk/proximity-sensors-explained-types-applications-and-benefits