What are Young Adult or Middle Grade Comics?

An overall introduction to Young Adult and Middle Grade graphic novels. What does it mean to be YA or MG, and how do the stories cater to a younger audience?