When the slope of a line is very high, the line approaches to be a vertical line.
So when we have a line that approaches a vertical line, its slope approaches infinity.
Therefore the slope of a vertical line is undefined.
(Opposite to that, the slope of a horizontal line is zero)