yes though the whole chicken and egg thing kind of applies here. Its possible solar changes, or meteor impacts lead to the magnetic field changes, or glacial changes related to the distribution of water around the planet affect its as well.
They are all clearly related, but which if any came first is unknown.
What came first - the Earth !