In the UK, there are tech jobs all over the country. But there are probably more in London than everywhere else combined, especially if you're looking for the start-up unicorn types. I lived in a smaller city for a while after university, but there were very few jobs to choose from that interested me.
I moved to London for one job in particular at the time, but also safe in the knowledge that it would be easy to find another job. I've had 4 different jobs in London since then, and it's never been very hard for me to find something else that's suitable and interesting for me.
The same holds true for most of my friends from university - many of the moved to London because it was the most obvious option for finding a tech job. So it has a further concentrating effect, that people are more likely to know others who are working in the capital city than elsewhere in the country.
If I was seeking a new job and open to moving anywhere in the country, I could find one somewhere outside of London. But if I was already living in another city, it might be harder to find a job without moving. It might not be quite the same in US, where there are a number of cities around the country that are a similar size to London, but in the UK there are maybe only 2-4 other cities that are large enough to have a wide selection of jobs in one industry, and none besides London with a population of over 1 million.