  The radiation from afterglows of gamma-ray bursts (GRB) is generated in
collisionless plasma shocks. The two main ingredients behind the radiation are
high-energy, non-thermal electrons and a strong magnetic field. I argue that in
order to make the right conclusions about gamma-ray burst and afterglow
parameters from observations, it is crucial to have a firm understanding of the
microphysics of collisionless shock. I present the results of self-consistent,
three-dimensional particle-in-cell computational simulations of the collision
of weakly magnetized plasma shells: The experiments show how a plasma
instability generates a magnetic field in the shock. The field has strength up
to percents of the equipartition value. The experiments also reveal a new,
non-thermal electron acceleration mechanism that differs substantially from
Fermi acceleration. Finally, I present the results from a new numerical tool
that enables us to extract synthetic radiation spectra directly from the
experiments. The preliminary results differ from synchrotron radiation but are
consistent with GRB afterglow observations. I conclude that strong magnetic
field generation, non-thermal particle acceleration and the emission of
radiation that is consistent with GRB afterglow observations, are all
unavoidable consequences of the collision between two relativistic plasma
shells.
