A point of light - a star, eg, is not imaged as a point by any optical system, but as a blurred disc. The smallest that disc can be is when it is affected only by diffraction and not by optical flaws - aberrations. The blurred disc formed by diffraction is called an Airy disc. The Rayleigh criterion says that, under perfect conditions, you can just distinguish the image of two point sources if the first dark circles of the Airy disc do not overlap. The smaller the Airy disc, the closer together two points can be and still be separated: ie, the higher the resolution.
The diameter of the first dark circle of the Airy disc in microns = 1.22 x wavelength of the illuminating light in microns (green light is 0.55 and that value is often used) x F, the aperture. So the Airy disc is at its smallest, and the resolution is highest, when the aperture is biggest (this is why astronomers always want bigger telescopes). Diffraction is reducing resolution every time the aperture gets smaller. The catch is that some important lens aberrations, that reduce resolution, are also worse when the aperture is larger. As the aperture gets smaller the Airy disc gets bigger but resolution increases because the improvement in the aberrations outweighs the bigger Airy disc, until an aperture is reached where the aberrations are not getting any better but the Airy disc is still getting bigger, and resolution starts to decline. A lens with no aberrations is said to be "diffraction limited" (full stop): its blur circles are the size of the Airy discs. A lens where the bigger Airy disc outweighs the reduced aberrations at (say) f/8 is said to be "diffraction limited at f/8".
That has nothing to do with the sensor you put it in front of, just with how bad the aperture-dependent aberrations are.
When people say that a particular sensor "needs" a lens that is diffraction limited at (say) f/8 they are talking about something different.
To reconstruct accurately a signal of frequency x cycles per second you have to sample at 2x cycles per second. The smaller the sensor elements in a sensor ("pixels") the higher the sampling frequency and the higher the resolution. The D500 has 4.2 micron sensor elements ("pixels"), so it is sampling at 238/mm, so it can reconstruct a signal at 119/mm, or blurred discs 8.4 microns across. In contrast, a Nikon 1 V3 has 2.51 micron pixels and the P500 has 1.54 micron pixels. So the V3 is sampling at 398/mm and can reconstruct signals of 199/mm and the P500 is sampling at 649/mm and could reconstruct signals at 325/mm. But they can only do that if the blurred discs are smaller than 5 microns in the case of the V3 or 3.08 microns in the case of the P500. The Airy discs are the critical sizes at f/11 for the D500, f/7.45 for the V3 and f/2.3 for the P500. So the D500 "needs" a lens that is diffraction limited at f/11 and the V3 "needs" a lens which is diffraction limited at f/7.45 and the P500 "needs" a lens that is diffraction limited at f/2.3, but only in the sense that otherwise you do not take full resolution advantage of the sensor.
A statement that a lens is "diffraction limited at f/16" means that the measured resolution increased, or was pretty much the same, until f/16 and then got worse. But everything depends on how good your measurements of resolution are, and if they are made by target reproduction photography they may not be very good at all.