'Lean' is not a term you use with compression ignition engines, as there is no stoichiometric mixture for such combustion. Makes no sense to describe it as such. It's be like saying a log fire is burning 'lean'. It burns what you throw in there.
What you might mean is that they run at high manifold pressures as there is no 'throttle', which means they do not suffer from the zero load pumping losses of a system with a throttled intake track. This is why they are so well suited to turbocharging because any compression of the intake gases serves to improve the engine efficiency, and the turbo itself is recovering energy from the exhaust.
In a good design of diesel engine you'd fit a variable geometry turbo to maximise energy recovery from the exhaust, and it'd come out into the exhaust little hotter than ambient when it is running at maximum efficiency. I could get home from work and the exhaust on the Octavia was still cooler than body temperature.
But the primary reason diesels are more efficient is because the combustion happens at a higher temperature. Twice the compression ratio of petrol cars. Higher combustion temperature pushes the Carnot curve higher. Any combustion performed at higher temperatures results in higher efficiency, but the flip-side is that you also start, literally, burning the nitrogen in the air charge which produces the NOx.
If you ran a lean petrol engine to the same levels of combustion temperature, thus improve the thermal efficiency, you would generate just as much NOx as diesels.
NOx is purely a function of higher, and thus more efficient, combustion temperatures.
So diesels are more efficient because, in order of significance:
a) they run with much higher combustion temperatures,
b) they have low, or virtually non-existent, zero load induction losses, and
c) for turbo diesels, which are the norm now, they recover waste exhaust energy.