title: How does the emacs load the package?
body: <p>I'm always curious about the loading process of the package in Emacs. You know, Some packages are builtin packages, and some are third-party packages.<br>
  For example, you can install the "auto-complete" package from MELPA or MELPA-STABLE, or you can get the source from <a href="https://github.com/auto-complete/auto-complete" rel="nofollow">github</a>.<br>
  If you install the package from MELPA, you will find the package files in "~/.emacs.d/elpa/auto-complete***".</p>
  
  <pre><code>auto-complete-autoloads.el  
  auto-complete-config.el  
  auto-complete-config.elc  
  auto-complete.el  
  auto-complete.elc  
  auto-complete-pkg.el  
  dict;;it's a directory
  </code></pre>
  
  <p>What does the emacs do for us to install the package? It just downloads all the files from MELPA and puts them in "~/.emacs.d/elpa/auto-complete***"? How does the emacs know the existense of the auto-complete-package and load them when you start emacs next time?<br>
  I know I should add something to "~/.emacs.d/init.el" if get the source from github. Maybe like this  </p>
  
  <pre><code>(add-to-list 'load-path "path-to-download-folder/auto-complete")
  (require 'auto-complete-config)
  (ac-config-default)
  </code></pre>
  
  <p>But I can't see any changes in "init.el" if I install the package from MELPA. Maybe the emacs assign the path of the auto-complete to the variable load-path. But then?<br>
    How does the emacs load the package? How does it know my "ALT-x + command"?<br>
    And I really don't know the relationship of these files the emacs downloaded from MELPA and their function.
    Could anyone tell me the whole loading process of a package? What does the emacs do behind us to install the package from MELPA/MELPA-STABLE?</p>