Here's the thing: for a character as central as Miles is, we actually know very little about him...which is actually what makes him so mystifying and interesting.
Some people might complain about the comparatively small number of characters we really get to know in this story (the number hovers somewhere between one and zero – after all, can we really say we "know" the Governess?).
But we think that this odd distance from the actors in the story is what creates its Unsolved Mysteries-style appeal.
What we do know about Miles is this: he's ten, he's frighteningly smart and impossibly beautiful, and he's strangely savvy in the ways of the world – think about the ten year old boys you know, and Miles's precocity becomes strikingly apparent. We also know that he may or may not have the capacity to be incredibly bad; his schoolmasters declare that he's so wicked he can't even come back to school.
The cause of Miles's expulsion is one of the central mysteries in the plot; we find out at the end that he was kicked out merely for saying things, but it's up to us to imagine what he possibly could have said to other students that would merit such a punishment. One popular speculation on the nature of Miles's transgression is that he made comments of a homosexual nature to some of his fellow students—those that, as he says, he "liked."
That, of course, may not be your reading of the text. In fact, there are hints of something far darker than a simple crush going on between Miles and the boys that he likes. Just check out the Governess' response to this revelation:
Those he liked? I seemed to float not into clearness, but into a darker obscure, and within a minute there had come to me out of my very pity the appalling alarm of his being perhaps innocent. It was for the instant confounding and bottomless, for if he were innocent, what then on earth was I? Paralyzed, while it lasted, by the mere brush of the question, I let him go a little, so that, with a deep-drawn sigh, he turned away from me again; which, as he faced toward the clear window, I suffered, feeling that I had nothing now there to keep him from. (24.16)
Whatever his punishable acts may be, this additional unknown only adds to the suspense and the intrigue of the story.
Speaking of unknowns, there's the matter of Miles's death. His last words are mysterious: he calls out
"Peter Quint—you devil!" (24.24)
We're not sure if he's referring to Quint as a devil or the governess herself. Furthermore, we don't know why Miles dies. It's possibly because the spirit of Quint leaves him, possibly because of the shock of all this uproar, and possibly (dare we say it?) because the Governess herself harms him…
It's a mystery. And James clearly knew that what we as readers can imagine is vastly more frightening and haunting than what he, the author, could have ever committed to the page.