Stars evolve, and astronomers have a pretty good handle on just how fast stars age. So by looking at the stars in the cluster we can tell pretty well how old they are. Clusters of stars probably all form from the same collapsing gas cloud, much like how we believe the solar system formed. Once they form from the gas, the hot, bright stars burn and blow away the remaining gas in a process that, to be honest, is still not very well understood. Over time, the stars in the cluster pass near each other, and affect each other gravitationally.
Some stars can slingshot out of the cluster that way.
The biggest and hottest stars tend to blow up before they get too old, and we no longer can detect them easily. Also, the Galaxy itself has a gravitational field, and complex interactions with the cluster can strip stars away that way. Many stars in the Galaxy formed in clusters and were ejected in one way or another. You've probably seen a cluster without even knowing it. Many people mistake them for the Little Dipper, but the cluster is much smaller.