It is possible for a baby born vaginally at 37 weeks or later in a low-risk birth to have respiratory problems and need scbu. This usually due to infection or inhaling meconium. A baby born in poor condition due to lack of oxygen for some considerable period may also need respiratory support. There may also be some unanticipated cardiac, lung or medical problem which is only diagnosed after birth.This can happen unexpectedly.
Very occasionally it seems to be prematurity type problems, where the lungs are just not quite mature. This is much more likely if the mother has experienced gestational diabetes or has preexisting diabetes. Babies who experience a high blood sugar prebirth usually grow well (too well sometimes) but have delayed maturity. Clearly if you have undiagnosed high blood sugar then this is a risk.
We know the experience of labour helps to complete lung maturity due to the stress hormones (steroids) the baby produces in response to contractions. We also know that elective section babies are significantly more likely to have respiratory problems if delivered before 39 weeks. That is why the guidelines say to do elCS after 39 weeks now and to give antenatal steroids to the mum if it can't be delayed.