Wilkinson 2006 created the grammar of graphics to describe the fundamental features that underlie all statistical graphics.
The grammar of graphics is an answer to the question of what is a statistical graphic?
ggplot2 builds on Wilkinson’s grammar by focusing on the primacy of layers and adapting it for use in R.
In brief, the grammar tells us that a graphic maps the data to the aesthetic attributes (colour, shape, size) of geometric objects (points, lines, bars).
The plot may also include statistical transformations of the data and information about the plot’s coordinate system.
Facetting can be used to plot for different subsets of the data.
The combination of these independent components are what make up a graphic.