What does Arduino do every 1ms?

Timer 0 overflow interrupt. It's the interrupt that drives micros / millis.