This is an inaccurate statement and a faulty analogy that may well
contribute to confusing dramatically different technological concepts. The
difference between the two concepts is entirely functionally based.
Network Address Translation (NAT) comes in many flavors. But the heart of
the concept is that it's a method for mapping one IP address to another, be
it statically or dynamically. The most common variety has come to be the
overloaded version where multiple non-routable/unregistered IP addresses are
mapped to one publicly addressable/registered IP address. The reason this
is so popular is because of the relatively limited size of the registered IP
address range in IPv4 (this will hardly be a problem once IPv6 is adopted)
and thus the fact that most of us who pay for connections for our home don't
want to shell out for multiple static IP's from our ISP's as it gets
expensive because they're a somewhat scarce resource.
For a comprehensive but accessible overview of NAT, see:
http://computer.howstuffworks.com/nat.htm
Note, however, that the overloaded version is not the only implementation of
NAT. There is even a specification for static, 1:1 mappings between a set
of unregistered IP's (i.e. 192.168.1.1) and a set of registered IP's. All
traffic reaching the NAT box for a specific registered IP will be mapped to
the associated private IP address.
A firewall is commonly a piece of software or hardware that sits between two
network segments and is designed to prevent some network traffic from being
passed through it based on a specifically stated policy (paraphrased from
the wikipedia article on firewalls). Note, in the case of a software
firewall on an individual computer, the distinction between network segments
is logical only and not physical, but suffice to say that the firewall
software essentially sits between the OS's tcp/ip stack and the network
interface.
So, the difference between the NAT and Firewalls should be clear. NAT
systems are intended to map sets of IP addresses and Firewalls are intended
to actively inspect traffic and drop or allow traffic based on a
specifically formulated policy.
Using a dynamic/overloaded NAT implementation to allow a small network of
machines with non-routable addresses to access the internet via a single
routable IP address can make attacks from the outside more difficult as it
does break the concept of end to end connectivity that many network
protocols rely on, but it's not now, nor ever was it intended to be a
security measure. Depending on the implementation details and a NAT system
may still allow external access to the machines it sits in front of (this is
especially true in the case of static 1:1 mappings, but it may happen even
with the popular dynamic/overloaded implementations) Essentially, the
popular versions of NAT embody the concept of security through obscurity.
That concept has proven time and time again to be unreliable.
Now, that having been said, many of the cheap NAT boxes out there include
simple firewall implementations, but very few people actually make use of
those "advanced" settings in practice. My point, however, is and has been
that NAT and Firewalls are complimentary technological concepts but they are
intended for dramatically different purposes and neither is truly reliable
or effective at doing what the other does. -- To adapt the analogy I railed
against, you could call your NAT implementation coffee and the Firewall
cream. You might well use either separately, and they work well together
but you'd be mistaken to confuse the two.