Good question. To make the coaching shortened and accurate see the below tutorials.
The best answer is here
. That explains the workings of Grub 2 and how are the files apportioned to different folders. If you have question also about Grub Legacy (the 1st version) here
is a tutorial explaining it too.
Hope that helps.