It can be both. I know people who have it configured to be escape when it's pressed and released, but control when it's held down in combination with another key.
How do you do that? I normally use the keyboard preferences to change the capslock on my MBP to control. I'd like escape there too, but I'd like to avoid running additional software to enable it.
I use Karabiner and it's truly a wonderful piece of software. I'm super sensitive to any lag or missent keys, but this actually works very well and I don't even think about it anymore.
I'm not sure. I think on linux/X11 it's just xmodmap wizardry, any maybe on macos you need third party software, but don't take my word for it. It's not something I've really investigated since I'm personally satisfied with capslock=escape.