Trying to find out what NDEBUG and _DEBUG actually mean in Visual Studio, I came across a cppreference page which explains that NDEBUG is about whether the assert function works in the code or not.
What does debugging have to do with the assert function? Why do we have the name NDEBUG when defining the way assert should behave?
Update
To put the question more precisely, I'd like to know some implementation details. What is assert used for in debugging? What exactly do we have to assert? And why would we want to avoid such assertions?