What is gradle's internal architecture?

there are rules and exceptions to the rules all over the place.

How is buildScript{} processed independently?

How are delegates allocated to these scripts?

How are strings intepreted as alternate method names?

How is plugins {] block resolve to the respective delegate?

How is the syntax restricted?

what is the general architecture of gradle for Gradle contributors?