Dijkstra's algorithm is used to find the shortest path between a source node and all other nodes in a connected graph. It works by computing the shortest path from one particular source node to all other remaining nodes. The algorithm provides the cost or value of the shortest paths between the source node and all other nodes in the graph, whether directed or undirected.