They use a microcontroller, that also generates the 3-phase output switching waveforms.
The simplest way for a microcontroller to read a pulse width is with the internal timer peripherals. It varies a bit with the type of MCU, but generally a counter (perhaps 16 bits wide) is started at the positive edge, counts some fixed frequency pulses based on the MCU clock, and then triggers an interrupt or flag when the negative edge occurs. The value in the counter gives you the width of the pulse. You can have another timer running that times out if a new pulse is not received within a set period of time.
Even an internal RC clock is good enough in stability and accuracy to read that kind of PWM.
If the counter clock frequency is, say, 4MHz then a 16-bit counter can measure up to a 16ms pulse with +/-125nsec resolution. A crystal clock would be good to a few tens of ppm accuracy, an RC clock probably to +/-0.5%.
If you want to know more about a specific ESC, look up the full datasheet for the particular MCU they designed in, and read the datasheet section on timer-counter peripherals.