US Govt treasury bonds, 10 year, 30 year, etc, are the benchmark credit-risk free rate. Think of it as the "minimum cost" of borrowing money. These rates move up and down to a variety of factors - overall health of the economy, rate of inflation, or as a "safe haven" in times of crisis, to name a few.
Mortgages have credit risk - the risk of default. This can depend on the credit-worthiness of the borrower as well as the length of time they are planning to borrow. So to compensate a lender, they demand a risk premium (additional interest) over what treasury bonds would pay. This is called the spread.
Now the relationship is that there will always be a spread between treasuries and mortgages. Now this spread is not a fixed amount, it is determined by the market any given day.
When Treasury bonds decrease in yield, mortgage rates tend to decrease in yield too, as the "risk free rate" (treasuries) is now lower. However, because that credit spread is determined by other factors (defaults, credit standards, etc) mortgage yields might not go down as much (known as spread widening) or they might go down more than treasuries (know as spread tightening.)
Before this year, the market did not see much credit risk. Afterall, with a booming housing market, if someone couldnt make their payments, they could sell their house and everyone would get their money back. So consequently, the spread (yield difference) between treasury bonds and mortgages was tightening. Lets say the difference is 2 percent.
10 year treasury = 5%, Mortgage = 7%. As the mortgage spreads tighten:
10 year treasury = 5%, Mortgage = 6.5%.
This is spread tightening.
Now lets look at this year. In a nutshell, the housing market is soft, which means if someone cant make their payments and tries to sell their house, they might not get enough money to pay everyone back. This would result in default. So the risk premium (spread) increases. In this case:
10 year treasury = 5%, Mortgage = 7%. As the mortgage spreads widen:
10 year treasury = 5%, Mortgage = 7.5%.
This is spread widening.
So putting this altogether: treasuries move up and down based on their own reasons - economy, inflation, etc. Mortgage rates use this rate as a benchmark, but will add their own credit-risk spread on top of that.
So mortgage rates will generally track treasuries, but sometimes not as fast.
Right now, you have a situation where treasury yields are going down, and mortgage rates are going up. Why?
Your mortgage is packaged and sold to investors. With credit risk getting worse (more people defaulting on their mortgages), these investors are selling these investments. They are taking their money and investing it in the treasury market. This is called "flight to quality" This increased demand for treasury bonds is pushing yield down.
But mortgages are getting riskier, so that credit spread is getting wider. Now you have
10 year treasury = 5%, Mortgage = 7%. As "flight to quality" occurs:
10 year treasury = 4.75%, Mortgage = 7.5%.
I hope this helps you understand the relationship. Obviously the rates were purely illustrative, and the overall factors that affect the market were simplified, but it should give you the basic idea