Prim's algorithm is a greedy algorithm used to find minimum spanning trees for weighted undirected graphs. It operates by building the spanning tree one vertex at a time, from an arbitrary starting vertex, at each step adding the minimum weight edge that connects the growing spanning tree to a vertex not yet included in the tree. The algorithm repeats until all vertices are added.