A “sophisticated” UK-based spy ring passed secrets to Russia for nearly three years, a court has heard.