There's no definitive historical record of the term's origin, but this explanation seems plausible given the visual characteristic of a black eye.
However, some sources suggest that the term "shiner" could also be connected to the shininess of the eyelid when it's swollen due to bruising.
Regardless of the exact origin, "shiner" is a widely recognized and commonly used slang term for a black eye.