The medics caring for her obviously think there is some chance the baby could be born early. This could be due either to signs of premature labour (e.g. if waters have gone or contractions etc.) or due to bleeding issues (e.g. severe placenta previa) or due to pre-eclampsia/severe IUGR (intra-uterine growth retardation).
The steroids help advance lung maturation by increasing the production of the surfactant needed to breath in air. The length of their effect is debatable, normally thought to last 2-3 weeks, so if baby does come in that time it has an advantage over one that hasn't had steroids and should make for fewer breathing issues/less time on ventilator or CPAP etc.
Both my DCs had steroids, and my eldest came at 30wks - however he only got one shot of steroids and hour before the crash caesarian so they didn't have time to work (2 shots are needed, spaced by 24hrs, for full effectiveness). My youngest also had steroid injections at 27 weeks, and again at 35 wks- she was born at 36wks. Mine were early due to pre-eclampsia, and my eldest was in SCBU for 8 weeks- they are both fine now!
It is a very scary time but many women who have the steroids don't end up giving birth prematurely, but it is a good precaution as it really helps the babies if they do come early.
Thinking of your niece hope they are ok x