The database name (test_db) is the name by which SQL Server knows the database. With the exception of SQL to Operating System issues, this is the only name that SQL Server uses for this database.
The filename is exactly as you've described it... It is the name of the physical file being created or managed.
In the days of dragons (circa 1990) there was a plan to establish SQL Server as a full-blown operating system in its own right, as well as running on other operating systems (like Linux, OS/2, and NetWare). This name associated with SQL Server files allowed the SQL Server developers to neatly sidestep all of the gory details of the underlying file system by creating a name for the file that was independent of the underlying Operating System (or lack thereof). It remains a convenient way to dodge a lot of otherwise hard to avoid problems, so the structure lives on and does provide some useful abstraction under the covers.
In theory, theory and practice are identical. In practice, theory and practice are unrelated.