The black box is just a sticker
The original text and image are still in the file, underneath the rectangle.
We do not draw a box over the content. We rebuild the document without it. Redacted text characters are dropped entirely and image pixels are overwritten in the image data itself. Delete the overlay in a PDF editor and there is nothing beneath it; select the text and there is nothing to copy.
The redacted region is solid black in the raw pixel data while everything outside the box is preserved. The content is overwritten, not visually hidden.