Dijkstra's algorithm is used to find the shortest path from a source node to all other nodes in a graph. It works by maintaining two sets - S, the set of nodes whose shortest paths have been determined, and V-S, the remaining nodes. It initializes distances and predecessors, then iteratively selects the closest node u in V-S, adds it to S, and relaxes edges to nodes in V-S connected to u. This process continues until V-S is empty, at which point the shortest paths to all nodes have been determined. The time complexity of Dijkstra's algorithm is O((|E| + |V|)log|V|).