“le mien” in the sentence above replaces “mon stylo”. When we use the possessive pronouns, we generally want to avoid repetition or emphasize the possession of an object. Observe the following example:
Mes parents sont très stricts alors que les tiens sont très ouverts. My parents are very strict whereas yours are very open-minded.
“les tiens” in this sentence are used to avoid repeating the word “parents”. So, instead of saying: “Mes parents sont très stricts, alors que tes parents sont très ouverts”, we replaced “tes parents” par “les tiens”.