There are several types of Drupal module - node, block, filter, etc. Each module needs at least 2 files. The first one is module_name.info and the other is module_name.module. The info file contains information about the module and the module file is the actual source file. If the module needs any action during installation, then required code goes into the module_name.install file.
Now it should be clear that the main magic resides in module_name.module file which is an ordinary PHP source code. Once you master those magics, you become an expert Drupal developer. In this article, I'll try to annotate various tutorials so that the journey to Drupal expertdom is shortened.
The only book that extensively describes the module writing process is Pro Drupal Development. However, this might be a bit confusing for someone totally new to the module development process. A comparatively easier explanation is provided in the Drupal website itself. Another good starting point is here.
API reference should be also consulted once you reach an advanced stage.