The way we do this is by taking advantage of a basic electronic property of resistors and capacitors. It turns out that if you take a capacitor that is initially storing no voltage, and then connect it to power (like 3.3V) through a resistor, it will charge up to the power voltage slowly. The bigger the resistor, the slower it is.
This technique only works with sensors that act like resistors. however, there are quite a few fun sensors that act this way: photocells, thermistors (temperature sensors), flex sensors, force-sensitive resistors, and many more.
It cannot be used with sensors that have a pure analog output like IR distance sensors or analog accelerometers.