aptitude package manager's search function can match virtual packages as follows:
aptitude search '?virtual'
build-essential isn't such a package - in Debian terminology, a virtual package is described as follows:
A virtual package is a generic name that applies to any one of a group
of packages, all of which provide similar basic functionality. For
example, both the konqueror and firefox-esr programs are web browsers,
and should therefore satisfy any dependency of a program that requires
a web browser on a system, in order to work or to be useful. They are
therefore both said to provide the "virtual package" called
So for example the virtual package
xserver may be provided by any of
$ aptitude search '?provides(^xserver$)'
p tigervnc-standalone-server - Standalone virtual network computing server
p tigervnc-standalone-server:i386 - Standalone virtual network computing server
p tightvncserver - virtual network computing server software
p tightvncserver:i386 - virtual network computing server software
p vnc4server - Virtual network computing server software
p vnc4server:i386 - Virtual network computing server software
p xnest - Nested X server
p xnest:i386 - Nested X server
p xserver-xephyr - nested X server
p xserver-xephyr:i386 - nested X server
p xserver-xephyr-hwe-18.04 - nested X server
p xserver-xephyr-hwe-18.04:i386 - nested X server
i xserver-xorg - X.Org X server
p xserver-xorg:i386 - X.Org X server
p xserver-xorg-hwe-18.04 - X.Org X server
p xserver-xorg-hwe-18.04:i386 - X.Org X server
p xvfb - Virtual Framebuffer 'fake' X server
p xvfb:i386 - Virtual Framebuffer 'fake' X server
Unfortunately I don't think there's a specific search term that would let you identify "packages like"
build-essential - I've seen it sometimes referred to as a dependency-only package, but that's not strictly true since it does install some files of its own.