I asked Amalthia about this and her answer is inevitably a very sweet, "I don't know! I just like it when he does!" And then she tells me to shut my piehole and go write something for her. So I will, but first I need to talk to someone about it!
Here's the background I have gleaned from Teen Wolf.
When the season starts, Allison is 16. She turns 17 in Season 1; which seems to support that Allison is a year older than her peeps. She seems embarrassed by this (and doesn't want anyone to think she got kept back a year for whatever reason); and Scott endears himself to her by firmly stating that it must be because her family moved around a lot. Anyway, it seems canon that she's a year older than her peers. Which makes the rest of the characters to be 15 about to turn 16 at some point that year.
I think Stiles is 16. Let's just say that he is. (Though no birthday is mentioned.) I mean, he could be 15, about to turn 16; perhaps there was some allusion that his birthday is in the spring? On Tumblr or somewhere?
Many stories seem to want to make Stiles older than that, like 17 about to turn 18 (which would make him older than Allison!), on account of the underage squick some get when they realize how young Stiles is compared to Derek.
Derek is 19 in the pilot script. I saw an image of the script on Tumblr. And if the fire was six years ago? That would make him, oh, 13 when Kate Argent seduced him? Ho, ho, ho, naughty Kate!
I think the writers realized what they'd done as the season went on, and perhaps were thinking of him as somewhat currently older, perhaps 22 or 23, so that Derek is 16 when Kate seduces him.
Stiles clearly states, "He's only a few years older than us." I take "a few years" to mean three to five years? Stiles is 16-ish? Which makes Derek 19 to 22 years old. At any rate, what I get from all of that (and it's only guesswork on my part) is that Stiles and Derek are relatively the same ages that Derek and Kate were when they had their little affair. (And doesn't that make things interesting!)
So then, I went and looked it up, like you do. Here:
Q: What is the legal age of consent to have sexual intercourse in California?
A: 18 years old. This means sexual contact with a minor under the age of 18 is illegal in the state of California even if the minor says it is consensual.
So there's that. And. ILLEGAL. Stiles is ILLEGAL, no matter how you write it. At least in the state of California.
Then I went and looked up my own state, Colorado. Which has a slightly different twist. Here's the text:
The statutory age of consent in Colorado is 17. There are varying factors that can make the crime more serious or less serious depending on the "difference" in age between the child and the perpetrator. There are also laws specific to "electronic" solicitation of a child via the internet. Three statutes are outlined below.
18-3-404. Unlawful Sexual Contact.
(1.5) Any person who knowingly, with or without sexual contact, induces or coerces a child by any of the means set forth in section 18-3-402 to expose intimate parts or to engage in any sexual contact, intrusion, or penetration with another person, for the purpose of the actor's own sexual gratification, commits unlawful sexual contact. For the purposes of this subsection (1.5), the term "child" means any person under the age of eighteen years.
So....It's okay if you're 17 to have sex, but if you have sex with anyone under 18, it's illegal. (???) There are too many variables, which makes the law wide open to judicial interpretation. At least they take into consideration the age differences between the characters, which I assume means if you have someone who is 19 and the other person is 17, that the law will take that into consideration.
But as far as the TV show goes, and the fact that this is a Fictional Character we're talking about, I can take some poetic licence, I think. But...I still have questions.
If Sheriff Stalinski finds out that Derek (19 - 22 years old) is having S-E-X with his SON (15 to 16 years old) he's going to either arrest Derek or shoot him in the head.
Given that Stiles is very much the guy to go look things up...he would have found out about the California law and determined that Derek would be in grave danger if Stiles told his Dad. He would never, therefore, willingly tell his dad. He would certainly never do it on a whim, or just for yucks.
So either the writer has to make it so that that Sheriff Stalinski never ever, ever, ever finds out or...the writer has to assume that the Sheriff will bend the law to suit the needs of his family. And given that the Sheriff is an elected official and must care pretty deeply about the law, I hardly think that the second option is likely. He's more likely, when he finds out, to take a gun and turn Derek from a rooster to a hen with one shot. (Thank you Nine to Five!)
Teenagers sneak around, they just do. Stiles does. He lies to his Dad all the time! Even when he's caught lying, he continues to lie until the lie is flattened by circumstance or his dad. ("What would you call lying?" "Being in a horizontal position?")
So why would he tell?
Granted, Sheriff Stalinski doesn't seem to do anything about Stiles' habit of lying. Additionally, when he finds Stiles all beaten up by Grandpa Argent, he swears he's going to get those kids (the ones that Stiles said beat him up) ...and then doesn't. It's not that he's not the GREATEST TV Dad of All Time, because he is! Don't get me wrong about that. But I think he's a little caught up in his job, his grief about his wife's death, to really get involved with what is going on in Stiles' life. I mean, were there any ramifications for Stiles not showing to his own game, where he's in First Line? No, that night, he's with Derek, watching Derek get the shit beat out of him at the Beacon Hills Hospital. (Or was it the long-term care facility - and incidentally, why did no one notice a wolf-match going on there????) At any rate, Stiles never gets grounded or yelled at...for anything.
I can see why writers might assume that if the Sheriff finds out about Derek that he'd turn a blind eye, or just go along with it or whatever. And believe me, I've had some very cozy ideas about how the Sheriff might accept Derek as a member of the family. On account of a) he makes Stiles happy and b) Derek is a Good Guy, underneath it all. Once you get to know him. And he's handy around the house! In my head cannon, there's nothing he can't fix, and he remains unflappable in the face of anything from a clogged drain to another werewolf who's messing with Stiles. (And he cooks, you realize this, right? No wait!!! He GRILLS. Of course he does. He builds a fire in portable grill on the Stalinski's back porch, and when the Sheriff comes home, there's half a deer roasting in the coals, and boy, does it smell good! Can't you just see this? Who wouldn't love a guy like that in the family?)
Logically...eventually, the Sheriff would find out, because just how many times will Stiles end up being seen to be with Derek or getting rescued by Derek or being in strange situations with Derek? It's going to become blindingly obvious, even to the slightly rumpled, overworked Sheriff Stalinski. And parents aren't totally blind, they just choose to be, when they need to.
Eventually, in canon, the Sheriff figures out that Derek didn't start the fire or kill his sister and golly, he's just the innocent victim in all of this. Still. You're a parent, let's say. You're the parent of A Stiles, and you find out he's been hanging around with the leftover child of the Hale fire, the once Person of Interest to the Law, the scruffy, black Camaro driving, slightly dubious Derek Freaking Hale. Are you going to sit still for that? Not to mention, he's three to FIVE years older than your son. Your STILES. Your pale, 147, mole-freckled darling boy who is all you have left of your WIFE.
What do you do? Do you go along with it? Do you welcome Derek? Or do you take him aside and show him your gun?
As you can see, I think way too much about these types of things.