Once you have mastered the basic blinking leds, simple sensors and sweeping servos, it’s time to move on to bigger and better projects. The ATMEGA328 is a processor with no operating system and can only run one program at a time. Unlike your personal computer, the ATMEGA328 can't run multiple programs. That doesn’t mean that we can’t manage multiple tasks on teh ATMEGA328. We just need to use a different approach. Since there is no operating system to help us out, We have to take matters into our own hands.
Using delay to control timing is the first things you learned tp control LED's etc. Timing with delay is simple and straightforward, but it does cause problems down the road when you want to add additional functionality. The problem is that delay() is a "busy wait" that monopolizes the processor.