Dijkstra's algorithm to find the shortest length between a given pair of vertices \(a\) and \(z\) proceeds as follows starting from the vertex \(a\), the algorithm finds new vertices iteratively in such a way that all the shortest paths are found from \(a\) to the vertices in the order in which they are found. The algorithm to find the shortest path between \(a\) and \(z\) terminates the moment \(z\) appears as a new vertex that has been just added.
In order to find the shortest path between \(a\) and all the vertices, we don't stop the algorithm at the vertex \(z\) (unless \(z\) is the last vertex to be introduced). Instead, we continue introducing new vertices till there are no more vertices to be added as new.
In other words, the extended Dijkstra algorithm terminates only when all the lengths of all the shortest paths from \(a\) to all the vertices have been found).

As an example, consider the weighted graph above. If we run the algorithm, we will find the shortest paths from \(a\) to \(u\), \(v\) and \(w\) as well ( the algorithm does not stop with \(z\)).