TeX outputs device independent (DVI) files, which as the name implies, are intended to be independent of the output device. As such, they are not understood by, e.g., browsers and lack information such as font shapes. Thus a backend is needed to translate from a DVI file to an image.
Although it is possible to generate web graphics using other DVI backends such as dvips followed by a PostScript-to-image converter like ImageMagick, using dvipng is more lightweight and requires less programs to be run, making it faster in practice. As such, it is a standard part of most TeX distributions.