What are some of the fundamental principles that govern the reactivity of molecules? What makes a molecule a good nucleophile or a strong electrophile? How can we predict which position of an aromatic ring undergoes electrophilic or nucleophilic substitutions? The simple understanding that a nucleophile is electron-rich molecule that attacks sites with low electron density, and that electrophile is electron-poor molecule that will attack a position of large electron density allows to understand many organic reaction.
For example, consider a diazo coupling reaction in which benzenediazonium chloride reacts with aniline. One can deduce from the positive charge that the diazonium group is very electron-poor, and thus acts as a good electrophile. Aniline acts as a nucleophile but what is the nucleophilic site? Recall that in aniline, the lone pair of the amino group is delocalized. Consideration of possible resonance contributors to the conclusion that the ortho and para-positions in aniline are nucleophilic. The ortho position is sterically hindered, and one could correctly predict that the azo compound forms when the electrophile attacks the para position of aniline.
In other situations, this simple understanding is insufficient. For example, how can we rationalize the observed preference of nitration of the 1-position in naphthalene by nitric acid if the total π electron densities in the 1 and 2 position are expected to be the same? Recall that in the nitration reaction, nitronium ion (NO2+) acts as an electrophile, and naphthalene behaves as a nucleophile. But which position in naphthalene is more nucleophilic? In principle, the answer can be reached by considering the structures and energies of the two transition states leading to the two products but this approach is often impractical.
A powerful practical model for describing chemical reactivity is the frontier molecular orbital (FMO) theory, developed by Kenichi Fukui in 1950's. The important aspect of the frontier electron theory is the focus on the highest occupied and lowest unoccupied molecular orbitals (HOMO and LUMO). For example, instead of thinking about the total electron density in a nucleophile, we should think about the localization of the HOMO orbital because electrons from this orbital are most free to participate in the reaction. The image on the right shows the distribution of HOMO in naphthalene; we can see that the frontier electron density is highest at the position 1. Thus, the electrophile reacts with position 1 of naphtalene.
Similarly, the frontier orbital theory predicts that a site where the lowest unoccupied orbital is localized, is a good electrophilic site. The FMO theory was initially used for explaining the electrophilic substitution in naphthalene but it became gradually clear that the scope of this theory is much broader. For example, the concept of frontier orbital symmetries was successfully used to rationalize the outcomes of cycloaddition reactions and other pericyclic reactions. Frontier molecular orbital models for some organic compounds are available here.
It should be recognized that the frontier orbital theory has its limitations. First, the application of theory requires somewhat complex calculations to determine the orbital energies and locations; it is often not the simple and intuitive model that an organic chemist is hoping for. In case of molecules with many functional groups or electron delocalization, it is common that the HOMO orbital are not strictly localized to a particular site but often span a large portion of a molecule, making the interpretation more difficult. The situation is only worse for the LUMO. Second, there are many examples where the reactivity is not controlled by frontier orbitals. For example, if the HOMO is involved in the aromatic system, it is less likely to react as an nucleophile or a base because this will lead to the loss of resonance stabilization. In other cases, the reactivity is determined by strong electrostatic forces rather than by frontier orbitals. Finally, in many cases alternative arguments can successfully explain the reactivity patterns. For example, the regioselectivity of naphthalene nitration can also be rationalized based on the relative stabilities of carbocation intermediates.
You can read more about the frontier orbital theory from Kenichi Fukui Nobel Prize lecture.