In hackers' jargon, a "metasyntactic variable", a sample name that is used to stand in for an actual page- or filename. Others include bar, baz, and qux. These get combined into "generic" filenames like foo.bar or foobar.baz. When used as actual filenames, foo and its ilk are understood to be for scratch-files.
Source: The New Hacker's Dictionary, ed. Eric S. Raymond, illus. Guy L. Steele, Jr. (Cambridge: MIT Press, 1996.)