The composition of Saint Ronan's Well was somewhat erratic. Scott began it immediately after completing Quentin Durward in early May 1823, and by the end of the month more than half of the first volume had been written. It is likely that he then slowed composition to avoid exhausting the market, and the volume was apparently not completed until late August or early September. Thereafter the pace quickened again, with the second volume finished and the third under way by mid-October, but then there came another slowing, and it is probable that it was into December before all was done. It seems likely that this second hold-up was occasioned by Scott's long resistance to the demand by James Ballantyne that the reference in the text to Clara's intercourse with Tyrell should be deleted: he eventually gave in, though signs of the original intention persist in the first edition.
Given its modern setting, it is not surprising that the sources of Saint Ronan's Well are predominantly literary rather than historical. It seems likely, though, that Clara's story was influenced by a protracted legal case involving a Border family, which ran from 1804 until 1820.