"Curses" is a library for writing, well, TUIs[0]. I get that's a bit circular, so let me explain.
With a normal CLI program, you essentially just output to STDOUT line by line. You type `git status`, and the git program basically does `print(status)`. Then you're back to your terminal and you type another command, git or otherwise.
A "curses" program renders fundamentally different. It's much more like how video games render. Every time it renders, it'll draw to the entire screen. You're not in an empty command line where you can type any command, rather you are "in" the application. Take a look at this screenshot [1]. You can imagine how pressing up/down keys might move which input is selected. If you want to get back to the normal terminal you have to quit the TUI application.
While not commonly thought of TUIs, generally vi/emacs/lynx/etc would all technically qualify (tho people might give you a strange look if you called them TUIs). To be clear, these do not use curses. They kind of predate curses and just wrote it manually. Curses is not a requirement ffor a TUI, but is by far the most common library to use when writing TUIs now-a-days.
[0] https://en.wikipedia.org/wiki/Curses_(programming_library)
[1] https://i.stack.imgur.com/oD7mJ.png