There is a mathematical relationship between the sensor size and the optical properties (particularly focal length) of the lens that affects the result.
Bigger sensors tend to have shallower depth of field for a given aperture, which requires stopping down the lens further or using lens movements to compensate to keep the subject in focus. But that can be desirable where you want to isolate a subject or otherwise create an effect.
However, stopping down further also tends to cause an increase in diffraction as the Airy discs become larger and start to engage each other in constructive/destructive wave interference which reduces the theoretical resolution of the system. This particularly affects smaller sensors but since you stop a larger lens down farther it also affects them as well.
And in contrast - smaller sensors need wider apertures for a given amount of subject isolation, but they are also subject to diffraction at much wider apertures. This means you need a lens that can deliver maximum resolution at very wide apertures. This is why your cellphone camera has a f/2 or f/1.8 lens, the sensor is tiny and it needs a very wide aperture or diffraction will rob the image of all sharpness. It's also why, for the most part, cellphone cameras haven't gone much above the 10-12mp range.
https://www.cambridgeincolour.com/tutorials/diffraction-phot...
(I've always suspected there is probably some asymptotic limit to the amount of resolution that can be extracted for a given amount of depth of field, even with an infinitely large film/sensor size. as you increase the sensor size you have to stop down further and the diffraction becomes stronger and limits the lp/mm)