Both Sony A9 and Leica SL2-S have 24.0 MP resolution sensors but Sony A9's sensor is Full frame (35.6 x 23.8 mm ) and Leica SL2-S's sensor is Full frame (36 x 24 mm ).
Since Leica SL2-S's has a larger sensor area with the same resolution, this means that it also has a larger pixel area hence better light collecting capacity for a given aperture compared to Sony A9.
One other difference between these two cameras that is worth mentioning is that Leica SL2-S's sensor doesn't have an anti-alias (Low-Pass) filter. Removing anti-alias filter increases the sharpness and level of detail but at the same time, it increases the chance of moire occurring in certain scenes.
Below you can see the A9 and SL2-S sensor size comparison.
Sony A9 and Leica SL2-S have almost the same sensor size so none of them has any significant advantage over other in providing control over depth of field when used with same focal length and aperture.