It was probably brought by a bird or maybe a neighbour had it. I haven't had one for some years now, they are interesting!
Mine appeared from nowhere too. I've had some other surprises appear from nowhere, I had Burdock (Arctium minus) in 2014 but not since.
A single plant of Lemon Catmint (Nepeta cataria citriodora) grew in a pot in 2011, it eventually died but I have a lovely lush plant growing since last year where the Burdock was.