A universal indicator changes color depending on the pH of the solution, providing a visual way to determine whether the solution is acidic, neutral, or basic.