It allows running and manage applications on a server, which provides resources to the applications. And it also allows building standalone Java applications, with the server embedded in it, in a way that you would expect from a framework.
On top of that, it provides standard Jakarta EE APIs, so your applications don't need GlassFish, you can run them on other servers too. Or you can easily migrte from other servers and frameworks to GlassFish if you like it more. And you can learn Jakarta EE APIs even before you will use GlassFish, or hire somebody who already knows it even though they never used GlassFish.
(i.e. in the same space as Jboss/Wildfly, WebSphere, etc)
Historically, it was also the reference implementation application server for J2EE.
Tomcat itself has never been an official reference implementation of anything.
Tomcat implements various Jakarta EE APIs, most centrallly Servlet indeed, but also JSP (Jakarta Pages) and JSTL (Jakarta Tags), WebSockets and Jakarta Authentication.
The initial Tomcat was donated to Apache, then used back in GlassFish. GlassFish WAS the reference implementation of Servlet (among others), so indirectly Tomcat kinda was the reference implementation indeed. But just a fork of its code via GlassFish.