So, what makes a book YA? I know an author who says that for a book to be YA, it only needs two things: the protagonist should be a young person, and the story should be about the most important thing in their life up to that point.
So how Y is YA? Your mileage may vary. Generally, kids like to read about a protagonist who is a year or two older than themselves, so a book with a 16-year-old protagonist would probably have an audience of 12-15 year-olds. But that's just a guideline. For one thing, if you write fantasy YA, you can set your story in a primitive culture where kids are considered adults at 15 or 16.
Some people think YA has to be bland, watered down— G-rated, basically. Not true. Writing YA requires a careful evaluation of plot and description, including deciding what to show and what to tell and what to hint at. But kids these days are not only well aware of the facts of life, they're exposed to plenty of violence, from the evening news to video games. Which is not say YA should be violent; there's no reason to off characters like they were shooting gallery targets, but neither is there a need to shield kids from the fact that people are mortal.
I started to read more YA once I started to write it. I find it a fun and challenging kind of book to write. We've all been young, but we all know more now than we did at 16. The trick is to make your characters believable for their ages, without making them too dumb to live or too wise for their years. I just finished reading an excellent YA book, Nation, by Terry Pratchett, and one thing I really liked was the way Pratchett merely hinted at the attraction between the two main characters. It was done deftly but never explicitly, so that the story could be read by someone very young who might have one understanding of it, and by an adult, who would perceive more layers of subtext to the narrative.
In other words, as with all stories, writing YA is a balancing act between imagination and reality, between what's on the page, and what's in the reader's head.