Hierarchical clustering is an unsupervised machine learning algorithm that builds a hierarchy of clusters. It works by assigning each observation to its own cluster, then combining the closest pairs of clusters until all observations are in a single cluster. A dendrogram is a diagram that illustrates the arrangement of the clusters and their individual elements. The document provides an example of performing hierarchical clustering on a one-dimensional data set of numbers and plotting the dendrogram to visualize the clustering results.