While dynamic characters are ones who change—either in personality, perspective, or physical traits—throughout a work of literature, foil characters (though they can develop, themselves) are ones whose traits contrast those of another character (usually the protagonist) in order to accentuate these contrasting characteristics.
Dynamic characters are usually employed by authors in order to illustrate a greater transition in the story—that is to say, their growth or detriment is often emblematic of a greater theme—while the characteristics which are contrasted by foil characters are often highlighted in a strategic way so as to signal the coming importance of such traits to the eventual plot.