It's a bit more hazy than the categories suggest, honestly. The big thing is that 'teen' novels, often called middle grade or upper middle grade, tend to resolve conflict within the family or immediate friend circle. The protagonist's world is smaller. YA, though? That's where the story forces the character to look outward, to question the society they're in or the systems they were raised with. The stakes get bigger, even if the plot is still interpersonal.
Romance is a good bellwether. In a lot of teen-focused books, a crush might be a subplot. In YA, romantic relationships are often central, exploring first intimacy, jealousy, or heartbreak with more emotional weight. Also, teen novels usually have a hopeful, forward-looking ending. YA can sit in ambiguity—endings aren't always neat, which mirrors that messy transition to adulthood.
I think the line blurs most with 'upper YA' and what some call 'New Adult'. A book like 'The Hunger Games' is shelved as YA but has incredibly dark political violence, which feels very mature. Meanwhile, a fluffy college romance might get the NA label just for having slightly older characters.