It's a Middle Grade novel, but the protagonist is only five years old when the story starts and, while the time span isn't specific, she only ages a year or two by the end of the book.
One of the basic requirements for a plotline is supposed to be that the main character wants something badly, makes several failed attempts to get it, and finally achieves the goal - unless the book is a tragedy. But in the beginning of this book Heidi wants to be loved and have a happy home. She gets that right away, looses it again, and regains it long before the end of the book. She develops and achieves several other goals as the book progresses.
Several things in the book are unrealistic, like children going from learning the alphabet to fluently reading complex material in a matter of days. And, although food is frequently described, nobody ever ate any fruits or vegetables.
So, why did I enjoy reading this book so much when I was a child? And why did it become a classic?
It completely carried me away into an unfamiliar world, the characters were believable and likable, and it had a happy ending. Probably what I liked best was the cozy, safe feeling it gave me.