well it's pretty obv that the emperor uses magic to enter her dreams but here is a much more crazier theory that just came up in my head:
her unborn child unconsciousless uses innate magic to show her pictures of a potential future where she lives happily with the emperor so that that particular future becomes more likely, and therefore thr child would (probably) have a happier future