Since 1651, the Persians, and Russians fought wars against each other for control in the Caucasus. But ever since 1722, the Persians lost more and more land in the Caucasus, and influence there.
The Treaty of Turkmenchay was a national failure for the Persians, losing a ton of Caucasian land...