The question is asked because discussions, sometimes heated, often seem to involve just one variable or, at most, two. For example, a post might be entitled: "Which is better, 12MP or 24MP?" and we can guess the kind of discussion that would lead to! Or, elsewhere, I read yesterday that a 24MP micro-4/3" camera would not be diffraction-limited! Sometimes, in such discussions, contrast gets a mention but often not.
Lately, the thought occurs that any discussion on camera resolution is incomplete without due consideration being given to:
pixel pitch (not MP)
acceptable MTF (as output by the sensor to in-camera processing)
Why pitch and not MP? By example: for 12MP: a 1/2.3" sensor has a 1.5um pixel pitch; a FF sensor has an 8.5um pitch. Which could explain why you can't set your compact camera to f/22! (diffraction, etc).
Acceptable MTF must be included because, even with a perfect lens, there are many combinations of pitch and aperture that give less than 3% MTF which means invisible details in your image.
These three factors include all of the other factors that are so often brought into a discussion and that usually have the effect of confusing the issue.
This opinion matches the concept of the Exposure Triangle almost exactly. Just as it can be argued that ISO has nothing to do with exposure per se, so the introduction of "acceptable MTF" may raise an eyebrow or two.
To be pedantic, one should include lens quality as a consideration. How that could be done is open for debate - here if you like. There is a calculation for the effect on MTF (due to lens manufacturing tolerances expressed as a fraction of a light wavelength) but it is a local-only value which does not account for the dreaded sagittal and meridional variations.