A ralation between, for example, variable x and y, is only a function if each value of x is related to a single y, that is, we can't have two different values for y related to a the same x value.
In a graph, given x is in the horizontal axis and y in the vertical axis, this means that we can't, in a function, have a vertical line that passes through the graph more than once.
So, a graph is only a function if there is no vertical line that passes through it more than once.