The disk space is marked free, but the files still exist until overwritten by something else. There are tools out there that can undo a format. You need to run it almost immediately after the accidental format since the more stuff you put on the drive, the greater the chance to be over written.
What Hawkeye22 says is correct most often, but not always. It depends on what kind of Format you perform, and on which Windows version you are using. Bear in mind, too, that any Format command operates ONLY on the Partition you are working with; it does NOT format any other Partition elsewhere on that same hard drive unit.
In ALL versions of Windows, if you use a QUICK FORMAT, what it actually does is re-write only the file management structures on that Partition on the hard drive. These are the places where Windows keeps track of file names, sizes, dates, etc., and of the allocation of sectors (or, more properly, allocation units) to each file as they are created. By completely re-writing all these files to fill them with zeroes, a Quick Format makes it almost impossible to find any file again, because all index information on them is destroyed.
HOWEVER, a Quick Format actually does NOT re-write the major portion of the drive - that is, all the sectors that actually contain the data. The data are still on the drive, but all the info on which sector belongs to which file, and in what order should they be assembled, is missing. This makes it extremely difficult to re-assemble the files into their original form, but there are several good software tools that can do just that. They make use of known tendencies of Windows to store things in a particular way, and of good deductive "guesswork" (not quite) to do the reassembly.
A FULL FORMAT does all that same work first, and THEN goes through the entire drive (that is, the Partition we're working on) and tests every sector to make sure it works properly. By "test", I mean it writes some known data to the sector, then reads it back and checks to make sure it is correct. If any sector fails, Windows records it as a "Bad Sector" in its own data file on the disk, and never uses it again. All of that takes a LOT more time than a Quick Format. Now, here's where the important differences between versions come in. Up to and including Windows XP, the Full Format process does additional things. As it tests each sector, FIRST it reads the existing data and stashes it away safely, THEN it does its data write and re-read, and FINALLY it writes that original data back. So even with this process, the old data still exists in the sectors after a Full Format. BUT in Win 7 (and, I'm pretty sure, in Vista), that saving and restoration of the old data is NOT done; instead it completely fills every sector with just zeroes, thus truly destroying all old data, as well as all the old file-tracking records. After this process, very few ways exist to recover any of the old data. There are a few VERY expensive and sophisticated techniques to recover the weak old traces of the original signals in the sector under the new zero entries, but even they can't recover 100%. And I don't think any such tools are widely available to home users.
For people actually wanting to destroy old data, you can also get so-called "Zero-Fill" utilities that will go through a complete hard drive unit (including ALL Partitions if you so desire) and fill EVERY sector with zeroes. And for those who really want to be sure to defeat even the sophisticated recovery tools, there are good utilities that do "military grade" wiping of the hard drive. These actually go through and write to each sector not just zeroes, but a sequence of several number patterns that collectively do remove even the faintest trace of any old data signals so that NO software tool can get ANY old data from any place. Once either of these are done you truly have an empty HDD, with no Partition or Format information on it, just like a brand new drive.
By the way, do not confuse any of this with a "Low-Level Format". That process is one that actually creates on a completely blank drive the magnetic patterns that define the tracks of data and the sectors of each track, with their own internal data validity check bits and so on, leaving places for the data to be written later. A long time ago this operation was actually done by early Format operations on hard drives, and it still is done when a Format is done on a floppy diskette. But it is NEVER done today on any hard drive by a computer user - you don't even have the software utility to do the job, nor the knowledge of how to do it. A Low-Level Format is done only in the factory that produces the drive. Your brand new empty HDD actually does have meaningful signals recorded on its disks to define the tracks and sectors. They just contain no data at all until you use tools to Partition and Format that unit.