I'm trying to get familiar with Emacs Lisp, its syntax, data structures etc, so I was wondering what are some built-in packages whose source could help me better understand how to use the language and learn its idioms?
I can recommend Ruby Mode in
ruby-mode.el and Python Mode in
python.el, for some aspects of their implementation. The former is a particularly great source for advanced indentation and navigation code based on the new SMIE engine. However, neither uses data structures in any particularly clever or advanced way.
I would also recommend some parts of Org Mode 8, for its design. Notably the exporter framework of Org 8 shows how to create an generic, extensible, object-like framework in plain Emacs Lisp. However, I'd recommend against most other parts of Org, for reasons already stated in comments: It's old, and full of legacy and harmful practices (e.g.
find-file-noselect to read files non-interactively).
Gnus is also said to have good code, but again I'd be careful to determine how well-maintained the particular piece of code is that you are looking at.
Since Emacs itself is very old, and only superficially maintained in many places, the average quality of its code is actually rather low by modern standards. There's many legacy stuff in there. For instance, even in core parts such as the byte compiler you'll find “TODO”s and “DUNNO”s dating back years, if not decades. Also, since Emacs is very slow to take code and developers from the “outside” community due to the restrictive policies established by the FSF, the overall quality increases only slowly.
All in all, you are more likely to find good code in popular 3rd party packages maintained by high-profile community members, e.g. Magit, Projectile, etc.