This so strongly reminds me of parts of the Ender's Game series, as well as some of Vernor Vinge's works. (I won't say which ones to avoid potential spoilers.)