How is this achieved?
As you can see in your screenshot, that Mac has a number of applications that use the menu bar - I can recognise 1Password, Docker, Dropbox, CreativeCloud. But, in addition, an app can display changing information in the menubar. It can, like the one shown, collect system information and display it - in this case network stats and probably disk use/free information.
I don't recognise the one being used here, but I thoroughly recommend iStat Menus which as well as showing configurable statistics in the menu bar, shows further detail in dropdowns.
The application's home page iStat Menus shows dropdowns and menu bars.
This is the app against which all menu bar displays are measured.
I am an enthusiastic user.