I was looking Arduino Mega's schematic and I noticed a resistor between the MCU and its resonator. R3 in this image:
Why is it there and what is its function?
That resistor limits the drive through the crystal. If the power applied to the crystal is too high then the slope and phase shift at the resonant frequency will not be optimal and at really high drive levels could cause mechanical damage to the crystal (like that shattered wine glass trick).
See good instruction PDF here, section 2.1.