According to lore in the Touhou series, Mishaguji-sama was an ancient and powerful curse god who plagued the Moriya lands in the time before the Yamato people and their gods took over. Suwako defeated and sealed Mishaguji-sama with her iron rings, and gained the worship and faith of the people.
Later, Kanako - one of the Yamato gods - challenged Suwako, and won. Kanako made the snake her symbol due to this (since snakes eat frogs), and took the onbashira (prayer logs) and shimenawa (sealing rope) as hers also. She intended to take Suwako's sealing domain with the shimenawa, since the circular shimenawa is like a snake that eats its own tail.
It's hinted that Suwako's power still keeps Mishaguji-sama sealed.