How does Drupal 7 Load its Modules I'm debugging a Drupal 7 system I didn't setup, and I'm trying to understand how Drupal loads its modules.  

This system appears to have modules nested within one other -- here's one example.

modules/custom/modulename/modulename.info
modules/custom/modulename/modulename.install
modules/custom/modulename/modulename.module
modules/custom/modulename/modulename_statistics/modulename_statistics.drush.inc
modules/custom/modulename/modulename_statistics/modulename_statistics.inc
modules/custom/modulename/modulename_statistics/modulename_statistics.info
modules/custom/modulename/modulename_statistics/modulename_statistics.module


It appears there's one module named modulename, and inside this module there's another named modulename_staticstics.  

Is this a "legal/normal" setup?  Does nesting one module within another confer any special features between the two modules?  Where in the drupal source code are modules searched for/loaded?  Is there any canonical piece of documentation that covers how module loading works? (my googling didn't turn up a lot)

(experienced software engineer here, but only passingly familiar with Drupal)
Is this a "legal/normal" setup?


It's perfectly legal, and yes it's normal for modules that need or want to break their functionality down that way.


  Does nesting one module within another confer any special features between the two modules?


No, they’re just standard modules.


  Where in the drupal source code are modules searched for/loaded?


I think this is pretty much exhaustive for Drupal 7:


/modules/**
/profiles/*/modules/**
/sites/*/modules/**



  Is there any canonical piece of documentation that covers how module loading works?


I wouldn't have thought so - following the code is probably the best way to understand how it works. Core is pretty well commented.