The relief that you get from the rituals is only temporary.
A ritual typically relieves only one thought, impulse, or image. A minority of people with OCD can do a ritual once a day and convince themselves that this will cover them for the entire day, but that is not common.
Usually, a ritual undoes one specific thought, impulse, or image and then has to be performed again when that thought, impulse, or image returns.
Because of the nature of OCD, the obsessions are intrusive, so they just keep coming back throughout the course of a day. If the rituals really worked to get rid of an obsession, then they would have to be performed only once; but the relief is only temporary, and the obsessions continue to return again and again.
The best way to get the obsession to stop returning is to stop doing the ritual and test whether the feared consequence really happens. When you realize that it doesn’t, you weaken the obsession, which will lessen the recurrence of the thought, leading to fewer rituals.