Mozilla was built upon the Netscape 4.0 source way back in 1998 as an open-source version of Netscape. Mozilla continued to mature through 1999, then in 2000, Netscape 6 was released, based upon Mozilla. In 2002, Mozilla 1.0 fas finalized, and Netscape 7 was built upon Mozilla 1.0. Then in late 2002, Mozilla created the Phoenix project as a browser-only version of Mozilla. The Phoenix project would later be renamed Firebird and then Firefox. Firefox 1.0 was released in 2004. Shortly thereafter, Netscape 8 was released, based upon Firefox. Then Firefox 2.0 was released in 2006, and Netscape 9 was based upon Firefox 2.0 in late 2007.
SeaMonkey is simply the continuation of Mozilla under a new name and different management.
To summarize:
Mozilla was based upon the Netscape 4 source.
Netscape 6 was 7 are based upon Mozilla.
Firefox was based upon Mozilla.
Netscape 8 and 9 were based upon Firefox.
Here's a graphical representation: