You are parsing it incorrectly.
The relevant phrase is not popular accept friends but eager to appear popular.
Look at it this way:
The danger comes when teens eager to appear popular accept friends that they don’t really know and post too much information thinking that only their friends will see their page.
The sentence could be rephrased in a couple of different ways too:
The danger comes when they accept friends that they don’t really know and post too much information thinking that only their friends will see their page.
The danger comes when teens who are eager to appear popular accept friends that they don’t really know and post too much information thinking that only their friends will see their page.
In any case, the subject is teens who are eager to appear popular.
In this construction, this set of teens is in contrast to those teens who are not eager to appear popular. So, you can't just say when teens eager to appear popular accept friends because you would be changing the meaning of the sentence. The eager to appear popular qualification is essential to the sentence.