Mortgage rates are based the 10 year treasury rate
The cheaper it is for Uncle Sam to borrow the cheaper mortgage rates are.
We pay more for mortgages because treasuries are guaranteed. Mortgages are pretty safe but not that safe so investors expect more reward for the extra risk.