Yes, there are distinct differences between pre-school-age, Middle Grade, and Young Adult fiction.
If you look at how children develop from infancy to adulthood, certain ages are distinguished by certain developmental "tasks". Very simply put, during early childhood (aproximately from birth until they enter school) children learn two basic things: to control their own body and what is what in their everyday world.
Learning to control their body begins with learning to sleep during the night (instead of in a four hour cycle), eating food (instead of being nourished through the umbilical cord), seeing and recognizing objects (newborns do not see), facial expressions (e.g. they learn to smile and react to smiles), moving their body with intent (including walking), and defecating at will. Many books for younger children tell stories about potty training, manipulating objects, or learning to ride a bike.
At the same time, pre-school-age children learn language (to communicate) and concepts, that is, the names of things and what these things are. They learn what is food and what isn't, animals, toys, and machines, and social concepts such as emotions (sad), relations (love, family, friendship), and so on. Many books for younger children simply name things or show children learning about the world (think of all the books and tv shows that have a child going to kindergarten or the doctor for the first time, resolving conflicts with playmates, experiencing love, etc.).
As I see it, there is no fantasy fiction for children of that age. Psychologists say that children begin to understand the difference between reality and fantasy (or fiction) at the end of elementary school (around the age of 10), and stories about magic or alternate realities only make sense if you understand the concept of reality first. There are talking animals and intelligent construction machines in books for younger children, but these aren't meant to be supernatural and depict an alternate reality.
As children learn to distinguish between reality and fiction between 6 and 12, they become increasingly interested in history (dinosaurs, Romans, knights) and fantasy (princesses, magic, dragons). Consequently, there are many non-fiction books about these topics for children in elementary school as well as much historical fantasy and alternate universe fantasy.
One predominant topic in Middle Grade fantasy is the concept of reality, and many stories deal with how reality and fantasy relate to each other. Many stories revolve around some means to enter or travel to alternate realities (the cupboard to Narnia or the Magic Treehouse) and how the two worlds affect each other. Usually something about reality can be learned in the fantasy world, and often it is a moral lesson. Religious fantasy falls into this category, as it deals with the relation between everyday reality and a fictional reality as well, telling of life after death, as in Lindgren's The Brothers Lionheart, or a world in which heaven, angels, and God are real, and what their existence might mean for our lives.
Besides learning about reality, children between 6 and 12 are mostly concerned with understanding what they themselves can and cannot do. The main developmental task is to derive self-confidence from competence and autonomy. Children of that age want to achieve the recognition of their parents, teachers, and peers through their abilities in sports, drawing, household tasks (cooking the first meal on their own), school, and so on. They want to be responsible and "do it right".
For that reason, most Middle Grade books show children who can do things. They catch thieves, drive vehicles, build spaceships, and they show social competence and manage their friendships and conflicts well.
Middle grade fantasy, in short, deals with
- how to get to the fantasy world
- what its relation is to the real world
- shows children that are capable and independent of adults and
- resolve social conflicts and build friendships
Young adult fantasy then deals with the typical developmental tasks (some say, problems) of adolescence: identity and one's place in society. In YA fantasy, just as in YA fiction in general, the characters have to find out who they are and what role they want (or must) play within their community. You have the protagonists overcoming their emotional weaknesses, the teenagers running away from a life preordained by their parents, the commoners who turn out to be royalty or otherwise destined to greatness, the discovery and eventual mastery of magical abilities. And of course you have first love, first sex, and friendship, either as wish-fulfillment in romantic fantasy or as a lesson on how to live a good life despite the fact that reality is usually more complicated than a daydream and often quite painful.
If you want to learn more about the details of how to write for Middle Grade or Young Adult audiences, what I recommend is that you go to your local public library and get a bunch of books for the age group and in the genre that you want to write, and read them. This will give you a clear idea of the conventions and themes in your market.