Birds and the bees talk and worse😡😡😡

So today I went into my 7yr old daughters room to ask her if she wanted to go to the store with me. She had a shocked look and quickly jumped to cover what she was doing. I then saw her Ken and Barbie doll naked on the bed with heads together and arms around each other. My daughter panicked and started crying. I asked what her dolls her doing in a calm tone and where she learned about that. She tried to lie and say that she was changing her dolls clothes and they weren't doing anything. She cried and kept saying how embarrassed she was. I talked to her calmly and reassured her she wasn't in trouble but I just wanted to make sure she understood what that was and where she learned about it.

So this is where I got mad. After she calmed down and started talking she told me that her best friend (who comes over regularly) told her about it. That her friend walked in on her daddy and step mom having sex and her dad said that babies happen when a man uses his hand to touch a woman's crouch. Then she wanted my daughter to play "sex" with the dolls and talk about it with her. MY DAUGHTER IS 7!!!! This is not the first time something inappropriate has happened with this friend too. A year ago I was messing with the settings on the family kindle and found several dozens pictures of my daughter in her panties on it and taken by this friend. I was PISSED OFF and got up in her mothers face when that happened. We had to have the serious talk with my daughter about never allowing that or touching to ever happen EVER! I ended up putting a ton more parental locks on the kindle just to make sure crap like that didn't happen again and wiping the memory. And now this!!! This is SICK!!! First the girl takes inappropriate pictures of my daughter and is now telling her about sex and wanting to play sex with the dolls!!!! WTF!!!! This is not normal!!! When I confronted the mom about it she seemed chill about it and said she will speak with her daughter about it but was going to give her the talk soon anyways because she will probably start her period in a year or two. The girl is 8 years old. Her mother also didn't seem to care when the photo thing happened a year ago. Her response then was "kids do stupid things, ain't a big deal". I'm sure if roles where reversed and my daughter took the pictures she would be all over me about it. We grounded our daughter for a month to make her learn how serious we where about the situation and the other girls mom just told her "hey don't do that again".

My problem with this all besides the obvious is why is this child doing these things that are very sexual and inappropriate in the first place???? I know she is in counseling by court order because her parents are split. The broke up before she was born and there was ALOT of issues. The kid has a lot of behavioral issues in general. This kid pisses me off because she has temper tantrums with pounding on walls and screaming, refusing to wear or do things and won't eat anything unless it's what she wants. She literally gets away with murder because her parents are each afraid to do the court battle again so they don't discipline her. She used to live in our spare room with her mom but I couldn't handle the daily drama with the kid so I had them move out. When the kid is with me I don't tolerate her crap and she listens when I tell her to do something but this is something I don't feel in in my realm of intervention.

All of this just makes me wonder if something else has happened to cause this sexual inappropriate stuff. Her mom has never mentioned sexual abuse but kids learn by example and witnessing things. This behavior along with her other issues just make my wonder.

Am I just overreacting??? What should I do??

FYI: my daughter and I had a basic birds and bees talk to clarify what "real" sex actually is. That she is not to listen or talk about it with friends again. Once my daughter calmed down we had a good talk and she said she doesn't want to play with her dolls that way again and will tell her friend it makes her uncomfortable and to stop. I said when she is ready we will have a more detailed talk about sex but until then enjoy being a kid. We believe to wait until marriage for sex and she said that is what she will do. When she is older we will open that can of reality but for now I am glad she seemed to understand our talk.