An SSRI is a selective serotonin reuptake inhibitor (it affects the neurotransmitter serotonin). This means that the drug prevents the reuptake of serotonin back into the neuron that released it.
When a neuron releases serotonin into the synapse between itself and another neuron, the releasing neuron then vacuums all of the serotonin back up so that it does not have to constantly remake serotonin again and again.
If neurons had to do this, our bodies would have to use a lot of energy just to synthesize more and more serotonin. So, the “vacuum” turns on, sucks the serotonin in the synapse back up, and holds it until it needs to be released again.
With an SSRI shutting off the vacuum, more serotonin stays floating around in the synapse, which means more chances for it to bounce onto the other neurons, creating more charges and therefore more chances for action potentials.
As more action potentials occur, then there is more activity in that area of the brain, and the increased level of activity can have a positive effect on OCD symptoms. For some patients, OCD decreases as serotonin levels increase.