(From my limited knowledge)
The major difference is how one is a form of OCD and the other is a form of paraphilia, which makes pedophilia objectively more dangerous as children are involved.
Pedophiles think about children when they fantasise. I read this comment in this thread months ago that summarised it perfectly.
Imagine yourself thinking about your life. You might think about spending it with someone. You imagine spending your best and worst times with them. You visualise falling in love with them. How you’d meet them at the alter, and how your kids will make silly jokes with another. A pedophile does all of this, enthusiastically, but they substitute it with a child.
A person with POCD on the other hand, does not want this. The easiest way the brain can attack you is by doing quick, immense damage, so it makes your body respond. A person with POCD is so against pedophilia that they want to ensure that even they themselves are not a physical harm to others.
My POCD started 2 years ago. Growing up I became overprotective of my sibling. I had a cousin who I was treating like a brother before my biological brother was born. One day, my cousin said “I bet my sibling would be okay if I beat the crap out of him using a baseball bat”. He was like 8, I’m not sure why he would say that but it made me paranoid. Every time we’re in a new place, meet someone new, go to a new paediatric for my brother, I get anxious. This is relevant.
In 2020, I watched something on twitter by accident. I was sent a link for some road accident, I swiped and I saw something that must have never happened, and must not be seen by anyone. My brain immediately thought of the man in the video, standing outside my house, looking at my brother. I had a lot of intrusive thoughts of him and my brother for 4 months. It was torturous to say the least. When I convinced myself that it would never happen, my brain put me in the man’s position. And that’s how my POCD started. My worst fear in my life, just kept pushing my brain to visualise for 8 months. One time, I just let go. My thoughts were running wild. I “agreed” to every thought just so it would shut up for once. It seemed to have worked, and I got a sense of clarity. Sometimes my POCD does spike, but at the end of the day I’ll never actually doubt myself to be a P because I know it’s just my brain’s fucked up way to ensure that nothing happens to my brother, probably as a trauma response to my own past.
TLDR: To answer your question, the difference is just intent, on varying degrees.