Its a macro that wraps the code you put inside of it to only be run based on the time interval you pass to it. The purpose of it is to allow for timer based code to be ran without having to block the main loop(). When the code is compiled it gets wrapped by other code that governs how the code inside it should run.
Lets say you want to run a method every 100ms. A simple approach would be the following:
// loop() runs the code within it over and over at a rate based on the
// how fast the microprocessor runs - specifically how long it takes
// for the processor to get through the code inside of it.
void loop(){
doMethod();
delay(100);
checkForButtonInput();
}
The issue here is that during the delay(), the delay() function, by its design, hogs all the processor time for 100ms, and so the checkForButtonInput() is not able to check for input, as the program is currently stuck looping inside of delay() until 100ms has passed.
EVERY_N_MILLISECONDS( <mseconds> ){} is the answer here, and you can think of it working to add code to you code like this (although this isn't exactly accurate):
void loop() {
EVERY_N_MILLISECONDS( 100 ){
//pseudocode
//if ( it has been 100ms since last time we did doMethod() ) {
doMethod();
// reset time since we did doMethod() to 0
//}
//else {
// continue...
//}
}
checkForButtonInput();
}
so if it hasn't been 100ms since the last time we were in the EVERY_N_MILLISECONDS wrapped code then we just move on, and so the checkForButtonInput() is called as much as possible and inputs wont be missed.