I've heard that sounds tend to be dubbed in afterwards, rather than being recorded live. Everything from walking to opening and shutting doors. What is the reason for doing this?
From the wikipedia page on Foley Artists.
Here is a great website on how it's done.
The main reason is really cost, plus you can get far better results in a Foley stage.
Recording sounds live is very expensive and difficult to get each of the sounds independently so that they can be properly mixed later. Say that you want to record the sounds you describe live where there are footsteps and a door shutting. You would have to record two separate sounds for each to allow for later flexibility in mixing the sounds. Furthermore you have the entire crew (who would need to be very quiet) waiting around while the sound guys do their work. Alternatively, they= sound crew could come back after the main crew leave and record the sounds, but this require access to the location for a longer period of time (and again results increasing the cost).
Or consider the case of a restaurant scene where the main characters are engaged in a conversation. When shooting such scenes, all the background people pretend to be chatting and eating but they have to refrain from making any background noise such are knives hitting plates. These sounds are added later which ensures that they are at the appropriate mixing level and the appropriate time so as to not distract from the dialog
Furthermore, a lot of sounds are added that were not part of the scene that was shot, for example outdoor ambiance: The sounds of crickets are added to indicate that this scene is a t night -- even in cases where such sounds would not exist as is the case for highrise in New York for instance. Or African jungle sounds are added to indicate that one is in the wild, even though the scene is in Vietnam for instance.
There is one notable except to this and that is when recording background ambient noise or "room tone". When shooting on location, there is always some background noise. In every day life we get used to hearing that and don't even notice it. At some point during the shooting of a scene the background noise will be recorded in case it needs to be mixed in later. This will involve all the normal sounds emanating from the film crew and the background noise. So for instance if the air conditioner went on in an adjacent room for one take of a scene, but was off in separate take of the same scene, this would be very noticeable when the scene was cut together. This room tone recording would be used to smooth out the background noise so that the ambient noise would not be too jarring.
If you really want to get a feel of how much work goes into the sound design, you need to close you eyes and not look at the picture. One of the best examples is the opening scene in Apocalypse now. Try it for yourself and see. Well, not see, but you know what I mean.