In a graph, an edge connects two vertices:

There number of edges emanating out of a vertex is called the degree of the vertex. In the above example, the degree of the vertex labelled "1" is 2, while the degree of the vertex labelled "5" is 3. Adding the degree of all vertices means you are adding all the edges emanating out of the vertices. For example, let \(d(v)\) give the degree of vertex \(v\):
Notice that there are 4 edges connecting with vertices "1" and "5". The sum of the degrees is 5 because the edge connecting "1" and "5" was counted twice. Similarly, if we add the degrees of all the vertices we get:
Doing this means we are adding all the edges twice. For example, the edge connecting "6" and "4" was counted once with \(d(4)\) and again with \(d(6)\). This means the sum of all the degrees is twice the number of edges (\(e\)):