Globular clusters are old objects; for example, M5 is about 13 billion years old. Such advanced age indicates they are stable, which seems at odds with the idea that over time, the gravitational influence of all those stars crammed in so small a space should cause the entire thing to collapse.
The key is that a globular cluster’s stars are all moving, orbiting the cluster’s center of mass. The energy of that motion — specifically, each star’s angular momentum — offsets the gravitational pull of all that mass and prevents the stars from falling toward the center and coalescing. When you average out all these orbits, they’re essentially random, which is why the cluster appears spherical.
Globular clusters do, in fact, evolve. Over time, gravitational interactions between two passing stars can “pass” angular momentum from one to the other, with more massive stars donating energy to those that are less massive. This leads to two effects: The first is mass segregation, which causes more massive stars to fall toward the center, while less massive stars are boosted toward the cluster’s outer edges. The second is evaporation — stars can be shot out of the cluster altogether. This process could, over extremely long timescales, cause the cluster to fly apart, rather than coalesce, as it loses more and more total mass to ejected stars.