My wife is a teacher. Her pay was mostly comparable to mine throughout our careers. My pay has literally tripled since working in London.
Currently, there are senior design and development roles in my home city of Bristol that pay less than what you’d get paid as a fast food manager.
It’s a mix of both. My wife makes good money as a teacher, primarily because she’s very senior in her role, and takes leadership responsibilities. Teachers are required in (mostly) equal measure everywhere, whereas software engineers always gravitate towards HCOL areas where the jobs are. If you’re not in one of these areas, you’re stuck with limited jobs, with limited pay.
My commute is close to two hours, one way, but the pay I can get here is over double what I’ll get where I live. Comparably, as a senior I probably get paid less than a new graduate in a HCOL city in the US.