This story is all about sex. Sex in ancient Greek mythology is kinda scary and kinda freaky (as I'm sure you've already noticed). And that kinda violent unpleasant sex is what begins and ends this story.
Cybele is "officially" a fertility goddess. Her mythic origin is Phrygia, but became very popular as an exotic divine import. Interestingly enough, she was one of the very few who actually refused Zeus (the big king god on Olympus),and she was relatively successful. But she wasn't completely successful, because while she was asleep, Zeus came and acting far more creepy than usually, masturbated and ejaculated on the Goddess's body. Being a fertility goddess, that was enough, and nine months later, out popped Agdistis.
There are alternative versions of Agdistis' birth, but they all involve Zeus getting himself off (another version says it is a wet dream that causes the god to ejaculate on the ground, thus fertilizing Gaia.
Now I know you might be wondering what this has to do with Attis, but stick with me. Agdistis was born a hermaphrodite, but her bi-sexed body totally intimidated the gods, who feared that her body made her so powerful that she'd take over the world. So they cut off her penis. They buried it in the ground and it grew into an almond tree (think about THAT the next time you eat a handful of almonds) and the daughter of the Sangarius river came along and, according to Pausanias, put one of the almonds between her breasts (whatever floats your boat ...). Although this may seem a little unorthodox, the almond disappeared and - surprise surprise - Nana (the nymph) found out that she was pregnant. She had a child named Attis - who grew up to be a major hottie, and then Agdistis fell in love with him. Agdistis, apparently, was still pretty intimidating, and Attis' relatives weren't down with her, so they sent him off to marry a princess, but Agdistis showed up at the wedding in true romantic style. The only thing is, when she stood up to say, "Wait! You can't marry that girl, I love you!" (or whatever), instead of everything working out happily ever after, Attis went completely nuts. He ran into the wilderness and castrated himself and, as this story goes, bled to death. His spirit entered a pine tree, but Agdistis was less worried about the soul, and more worried about the body, and she asked Zeus if he could preserve the body eternally for her. It's a little kinky, if you ask me, but as we all know, Zeus is down with kink, so he agreed and they put the body in a tomb in the sanctuary of Cybele (Rhea). Eventually, Agdistis became an epithet of Cybele's.
Story number two (this one according to Ovid) still has Agdistis as the unwitting and unwilling parent of Attis, but not so much with the bizarre incest. In this version, Attis is completely and utterly devoted to Cybele. Cybele demands what most women these days demand - a little fidelity. But in her case, this meant staying completely chaste. So my man (my boy?) Attis is trying to be good, but there's this nymph, Sagaritis, who's all over him. Finally, he (like all men) gives in to the nymph and gets down and dirty. Cybele, being a goddess, immediately figures this out and gets divinely pissed. She cuts down the hamadryad's (that would be Sagaritis in case you're not following) tree, and, Sagaritis dies accordingly (confused? read about hamadryads), but Cybele is not Hera to merely punish the girl. She also drives Attis insane. Attis immediately castrates himself but in this story he doesn't die. Instead, he (alternatively, Attis is now considered a "she") becomes totally dedicated to Cybele and is now seen driving around with her in her little lion pulled chariot.
I feel like it is worth mentioning that Attis was a gender neutral name in Ancient Greece. Hopefully you read into this as much as I do.