It is a tiny magnet inside a solenoid. At each end of the solenoid there is a steel part, which the magnets stick to when on or off. To switch state the coil is energized. Hall effect (or other) sensors can tell where the magnet is and what state the pin is in. It doesn't use any power when it's holding state but switching can consume a relatively high amount of power.
The clicky pen mechanism is actually patented, and it also can't be made as small as you'd like for this.
Does it really? This kind of mechanism is not reliable for 10k switches even... (Due to vibration damaging the pin.) And solenoids are nowhere near as small.
It may use nitinol wire, which can work with smaller latches. They can last trillions of cycles. I really doubt it though, making something at that size would be extremely expensive, unless they figured out a very simple way to work it.
It is a tiny magnet inside a solenoid. At each end of the solenoid there is a steel part, which the magnets stick to when on or off. To switch state the coil is energized. Hall effect (or other) sensors can tell where the magnet is and what state the pin is in. It doesn't use any power when it's holding state but switching can consume a relatively high amount of power.
The clicky pen mechanism is actually patented, and it also can't be made as small as you'd like for this.