After the military decides that Ender is their only hope for a win against the Buggers, they put him in a "training simulator" to test his abilities. Ender doesn't know that the battles are actually real, and that he is leading the Third Invasion to defeat them once and for all. The pressure of the battles, even though he thinks they are simulations, gets to him, and he starts to have nightmares. Mazer Rackham, his supervisor, seems unsympathetic with the quote:
"Strange dreams are a safety valve, Ender. I'm putting you under a little pressure for the first time in your life."
(Card, Ender's Game, Google Books)
His meaning is that Ender needs to toughen up and take the harsh schedule of the battles without complaint; the dreams are simply his unconscious mind trying to dump out all of its tension and exhaustion. However, Rackham also means that Ender's continuing excellence in battle is vital; they cannot afford to coddle him, and so the dreams are the only release his mind will have until the war is over. Ender cannot know this, and so he feels as if Rackham is being deliberately cruel.