The documentation on plots:-densityplot says
Any additional arguments are interpreted as options which are specified as equations of the form option = value. For example, the option grid = [m, n] where m and n are positive integers specifies that the plot is to be constructed on an m by n grid at equally spaced points in the ranges a..b and c..d respectively. By default a 49 by 49 grid is used; thus 2401 points are generated, and 2401 colored cells are displayed.
Consider the following simple example
If we look at the output from the print statement inside of g we see
That is, there are 16 points in the grid, not 5x5=25.
Is the documentation incorrect or did I miss something?