@AlexeyBobrick is correct. To add to his answer:
The scale of galaxy clusters are on the order of ~1Mpc (~3.14 Million light years in size), and are therefore much smaller than the cosmological horizon.
The cosmological principle is extraordinarily important for cosmologists, and makes the assumption about the universe's global properties (which turn out to be really good assumptions, so far):
- Homogeneity on the scale of about 100 Mpc. This means that one would see very little change in density within a bubble of radiua 100 Mpc as you move said bubble around the universe.
- Isotropy means that there is no preferred directions to look. No matter where you look, you should see roughly the same picture of the universe.
As for how these clusters are generated (addressing the title of your question), large N-body simulations are run over the age of the universe from different sets of initial conditions (this is where different models and assumptions come into it). These are dark matter only simulations and involve only the force of gravity. Some people are including electromagnetic interactions in their code, but it's far from being the norm, and are really only important on small scales, i.e. - inner regions of galaxies and clusters. These simulations can contain upwards of ~10 billion dark matter particles.