A nail gun drives nails, of course and does it quickly, straight and in high volume. A hammer will do the trick if you have only a few nails to drive. However, for major jobs, carpenters swear by putting the power tools to work.
Nail guns are usually air powered or electric. Some nail guns drive heavy-duty staples instead of actual nails, but the concept is the same. Drive it fast and true with a good nail gun.