The following quote comes from the excellent book, The Enemy Within, by Kris Lundgaard. This explanation of the connection between the mind, the affections, and the will has really helped me to understand temptation better and to put a greater value on Gospel meditation (because of the crucial role of the mind and how what it dwells on guides the affections). It is a great book and I really encourage you to get a copy.
The mind is the watchman of the soul. Its duty is to discern and judge what words, actions, desires, thoughts, beliefs, and emotions will please the Lord. The affections, when they are working as they should, long for and cling to what the mind says is pleasing to God, and are repulsed by what angers Him. When you “harbor wicked thoughts” (Jeremiah 4:14) the imagination becomes a pyromaniac dumping buckets of gasoline on the fire of your affections. They burn hotter and hotter, till the will melts like butter before them.