It's been explained in the JoS rituals page how they work. As for how they came to be, HP Maxine with Satan's guidance and after studying the Hebrew language first created RTRs for reversing specific curses in 2014.
I don't know if ancient Pagans did anything similar, but it doesn't matter anyway. In magick and bringing results in real life you use what works, no matter if its new or old. If a new technique is better than the one used in ancient times, then go with the new one. Magick is about producing results, not merely following tradition.
Satanism is a constantly evolving religion, we continuously gain new knowledge from Satan and research and not just follow some tradition.