DVI is a digital connection, the signal will be higher quality than VGA.
From an article
VGA is the only analog video connector in common use. An analog video signal is typically sent in three components: red, green, and blue (RGB). The color information is sent as a fluctuating electrical current, and the image quality can be degraded if the signal gets disrupted in some way, such as by interference. This is why with analog cables, the quality of the cable can actually affect the quality of the signal. In analog video cables, the information being transmitted corresponds to actual light values for the monitor to show.
Digital signals, which include HDMI, DVI and DisplayPort, send data as a stream of 1's and 0's represented by pulses of electricity. Rather than having a variable current, only a high and low voltage are sent, corresponding to the binary bits. Interference is less of a concern. Analog cables can theoretically carry information for an infinite resolution, while digital signals are limited by their bandwidth. However, this is rarely ever a problem, and the advantages of digital cables tend to outweigh this possible detriment.