A #define (and all other preprocessor directives, e.g. #include , #ifdef, etc) are handled by the C preprocessor (cpp) and not the compiler. #define is a basic search and replace text operation that takes place before the compiler runs.
I think the arduino team is rightly more concerned about how easy an example is for the user to understand than how efficient the code will be.
#define pin 13...digitalWrite(pin,HIGH);
#define pinOn digitalWrite(13,HIGH)...pinOn;
#define ITEM_CNT(x) (sizeof(x)/sizeof(x))
#defines are more efficient because the compiler can hard code the values in the hex file.
static const uint8_t pinLED = 13;
You can also define a variable with the const attribute to serve the same purpose.
#define pinLed 13