This may seem like a trivial question - most people who have been caving a few times have used cave surveys and can get some feel of what the cave is like from them. But what actually goes into the making of such a "map"?
The idea of the survey is to produce a map of the cave that is accurate, useful for route finding and possible connections (and look pretty). Enough detail needs to be recorded that every passage is recognisable, whilst those drawing up the map are aiming to convey a good overall view of the whole cave - including structure that may be far from obvious in one individual passage. The survey should also serve as a basis to "add value" like geological information and clues to how the cave was formed. Some of these aims conflict with one another when the survey is drawn up, but this is part of the "art" of survey drawing.
Recording the data in the cave is fairly straightforward, if time consuming. It does help to have an idea of how all the details that you record will be used. To this end, everyone is encouraged to draw up a survey to better understand the difficulties and thus to improve the standard of recording.
The basic survey is simply a series of straight lines connecting a number of points together. This is constructed by measuring the distance between points, and taking a compass bearing and clinometer reading from each point to the next. It does not matter which end these readings are taken from, as long as the notes make clear which end is from and which is to. Taking readings from alternate ends, called leapfrogging, is often the most efficient way to proceed, and helps mitigate some systematic errors. (ie. start 1 to 2, then 3 to 2, 3 to 4, then 5 to 4, 5 to 6 etc.)
Around this centre-line we need to draw passage detail in both plan and elevation - recording the dimensions and sketch of the cave. Easy.
However, the amount of information collectable is infinite and due to cold, impending exhaustion and rapid approach of call-out or derigging, time may be short. The handbook (in "Methods: underground") sets out what is considered the essential information and a few ways to collect it. Teams of two or three are used. If there are two of you it is generally accepted that one reads the instruments while the other writes it down and sketches, each person finds their own survey station. With three, two people can do as above while the third scouts for stations or one can do the instruments, one records the figures and the third sketches.
A survey party will never survey everything they see - but you should take particular care to note junctions, inaccessible passages and other possible ways on in the survey book. Some idea of how promising the lead is should always be recorded, as well as how hard it might be to get into. This will form the basis of the "question mark list" which will guide exploration in the future. That future may be as soon as another party a few hours behind, or may be several years later - currently each expedition generates more new question marks than it mops up old ones.
One other aspect of surveying that is not often done whilst in the cave is writing the passage description. Passage descriptions complement the survey and may clarify things that cannot easily be shown on the map. They are also a very useful cross check, helping to pick up some of the blunders that are occasionally made. They are best written by the party that does the surveying (though the initial explorers should also write as good a description as they can), and there is perhaps a lot to be said for actually doing this on the surveying trip rather than later back at base camp.
Surface surveys are basically similar, with the purpose of mapping the location of your cave, and how to get there. But there are enough differences and additional things to consider that they have their own page.