  The origin of interstellar and intergalactic magnetic fields remains largely
unknown. One possibility is that they are related to the primordial magnetic
fields (PMFs) produced by, for instance, the phase transitions of the early
Universe. In this paper, we show that the PMF-induced turbulence generated at
around the QCD phase transition epoch--the characteristic magnetic field
strength $B_{\rm ch}^* \sim \mathcal{O}(1)~\rm{\mu G}$ and coherent length
scale $\ell_{\rm ch}^* \sim \mathcal{O}(1)~\rm{pc}$--can naturally accommodate
nanohertz gravitational waves reported by pulsar timing array (PTA)
collaborations. Moreover, the evolution of the PMFs to the recombination era
with the form of $B_{\rm ch}\sim \ell_{\rm ch}^{-\alpha}$ can induce baryon
density inhomogeneities, alter the recombination history, and alleviate the
tension of the Hubble parameter $H_0$ and the matter clumpiness parameter $S_8$
between early- and late-time measurements for $0.88\leq \alpha \leq 1.17$
(approximate 95\% credible region based on three PTA likelihoods). The further
evolved PMFs may account for the $\sim {\cal O}(10^{-16})$ Gauss extragalactic
magnetic field inferred with GRB 221009A.
