I think macports is based on bsd ports. One difference between macports and apt is that macports compiles everything from source, whereas apt gives you ready brewed binaries.
MacPorts has been doing binary packages since MacPorts 2.0 (2011). It will compile from source when binary package is unavailable (e.g., non-default variant or newer OS release).