  Most clusters and groups of galaxies contain a giant elliptical galaxy in
their centres which far outshines and outweighs normal ellipticals. The origin
of these brightest cluster galaxies is intimately related to the collapse and
formation of the cluster. Using an N-body simulation of a cluster of galaxies
in a hierarchical cosmological model, we show that galaxy merging naturally
produces a massive, central galaxy with surface brightness and velocity
dispersion profiles similar to observed BCG's. To enhance the resolution of the
simulation, 100 dark halos at $z=2$ are replaced with self-consistent
disk+bulge+halo galaxy models following a Tully-Fisher relation using 100000
particles for the 20 largest galaxies and 10000 particles for the remaining
ones. This technique allows us to analyze the stellar and dark matter
components independently. The central galaxy forms through the merger of
several massive galaxies along a filament early in the cluster's history.
Galactic cannibalism of smaller galaxies through dynamical friction over a
Hubble time only accounts for a small fraction of the accreted mass. The galaxy
is a flattened, triaxial object whose long axis aligns with the primordial
filament and the long axis of the cluster galaxy distribution agreeing with
observed trends for galaxy-cluster alignment.
