Objects are visually perceived when they reflect light. A black object does not reflect any light. In other words, no photons are reflected to be detected by the photoreceptors in the retina. A black shape on a colored background appears black because its brightness approaches zero relative to its surroundings.
Black, as any other perceived hue, is a relative perception. The visual system, as any other sensory system, detects physical stimuli in a relative way. For example, under bright daylight (photopic conditions) a camera flash might appear as a weak source of light. That same flash viewed under dark (scoptopic) conditions may appear as a blinding flash. When the visual system is light-adapted, it needs a lot of photons to be able to respond to a visual stimulus. Under this condition, dark colored objects may appear black, simply because the photoreceptor's thresholds are too high. Conversely, that same dark object may appear as gray under scotopic conditions when the retina is dark-adapted (colors are not perceived under scotopic conditions - note here that black and white are not colors, but the two extremes on the perceived gray-scale).
An important thing to realize is that colors are perceptions and subject to neurophysiological processing imperfections. For example, blind people rarely perceive the world as black, despite the fact that their visual system cannot detect photons. Instead, they may perceive the world as a grayish hue, they often experience illusionary spontaneous flashes of light (phosphenes), or even entire visual scenes (Charles Bonnet syndrome). Hence, while a black object is physically defined as an object that emits/reflects no photons, it does not mean that the corresponding area in the neural representation of the visual field is silent. Perhaps on the contrary.