First, the purpose of the paperwork that you fill out is to fullfill the requirements of Federal law commonly known as the Brady law. It is your statement that you are not a prohibited person and it is the documentation that records the results of the NICS check. The form 4473 also serves as the documentation to remove the firearm from the dealer's bound book - their bound book shows where/who the gun came from and the 4473 documents where/who the gun went to. The form 4473 can also be used as part of a gun trace if requested, through the proper channels, by law enforcement agencies.
Assuming that by "What do they do?" you are referring to the FFL. The FFL will screen the 4473 form to ensure that you didn't put any disqualifying information on it. If you did, they will just deny the sale at that point. They will also verify that you have met the identification requirements set forth in Federal and state laws. Again, if you don't meet the identification requirements, they will deny the sale right then. After they have verified all the answers are appropriate and verified your identification, they will either call NICS or run the NICS check by computer. They will record the NICS reply on the form 4473.
Assuming they get a "proceed" answer from NICS, they will then record all the information regarding the specific firearm(s) they are transferring to you on the 4473. I believe up to 5 firearms can be listed on a single 4473. At the end of the day, they will clear the firearm(s) from their bound books and file away the 4473.
Finally, I never suggested answering "yes" to the question asked regarding if you had ammo with you or not just to test their reaction. You asked a question which would require conjecture and speculation on our part to answer. How the hell do we know why the FFL asked the question? We weren't there. We don't even know which dealer you are talking about or anything about the guy or his business or even what state you are in. I merely responded with a similar question which would require conjecture and speculation to answer.
How the heck could any of us know why he asked you the question. Maybe he wanted to buy the ammo from you. Maybe he would offer the "service" of verifying the ammo you might have with you was the proper caliber for the gun you bought. Maybe he might want to see if the ammo had corrosive primers or not and would offer advice on how to deal with corrosive primers. Maybe he wanted to see if the ammo was boxer or berdan primed to offer reloading information. Maybe he wanted to see if the bullets were bi-metal jacketed by checking them with a magnet.
If you don't want answers to your questions than I would suggest that you not ask them.