As you know, photo film is a suspension of salts of silver halogens (Swedish for salt maker) in gelatin. These silver salts are quite tiny. When exposed to light, the bond that holds the silver salt crystal together is weakened. The developer is a reducing agent that has an affinity for oxygen and it is able to reduce crystals with weakened bonds. We are taking a timed reaction. Given sufficient time the developer will reduce all however, in the time allotted it reduces essentially exposed crystal.
The reduction process liberates the halogen component and it is dissolved away into the water of the developer. The silver component of the crystal is thus liberated as a tuff of metallic silver. It is this opaque tuff of metallic sliver that makes the image you see. The tuff of metallic silver is not the grain structure you see. Grain is a clumping the many tuffs of metallic silver. Thus the degree of granularity is proportional to the density of the tuffs of metallic silver in any unit area.
Now the ISO of a particular film will be the average sensitivity of silver halogen crystals. Some will be totally insensitive to light thus they will not be reduced by the developer. Some will have weakened bonds (developable) from the start. These will be reduced forming an overall background density comprised of metallic silver. We call this a fog level or base fog level.
The bottom line is the granularity you see is based on the count of metallic silver clumps. Thus granularity is a variable based on the density of the image in any one unit area.
Grain as seen in the final print is not uniform as to granularity. Grain is more obvious in mundane areas like expanses of sky. In other words, the subject matter has much to do with our perception of granularity in a picture. The type of illuminant in the enlarger is a major contributor to our perception of granularity. An enlarger equipped with a condenser light source beams through the image on the emulsion. The directness of the light mitigates emulsion turbidity. This action adds to our perception of sharpness and granularity. A diffuser type enlarger light source scatters the illuminant. This method mitigates to some degree the granularity of the negative. Granularity in the print is seen in proportion to the density of the silver that forms the image.