Turning Brightness Into Characters
Converting an image to ASCII art works by mapping each region of the image to whichever text character's visual "density" best approximates that region's brightness — a character like @ or # reads as visually dense/dark, while . or a space reads as sparse/light, and the full conversion walks the image pixel-by-pixel (or block-by-block), substituting the closest-matching character for each region's average brightness level.
This is fundamentally a grayscale-based technique — color information doesn't directly translate into character density, so an image is first converted to grayscale (or brightness is extracted independently of hue) before the character-mapping step, which is exactly why a colorful but low-contrast image can produce a less detailed ASCII result than a monochrome image with strong brightness contrast, even if the colorful image looks more visually interesting to a human eye.
Adjusting detail scale (how many characters wide the output grid is) and contrast both meaningfully change legibility — too coarse a scale loses recognizable detail entirely, while too fine a scale on a low-resolution source image can introduce noise rather than genuine extra detail, since there's no more real information in the source to reveal at that finer grid size.