Look up “potentiometers” if you want to understand the workings behind a thumbstick as well as why drift happens.
So, drift happens because the graphite resistance element inside the potentiometers wears out over time due to friction, but these potentiometers are absurdly cheap compared to the alternatives and one company, ALPS of Japan, has dominated this market (not just for the Switch but for everybody) for 20 years that they pretty much out-prices everybody else. So, now you know why companies still use these thumbsticks despite the fact that drift always develop eventually.
Hall Effect sensors are definitely better, but also tend to be heavier and bulkier, so we’ll see if this works out.