Why does a photon colliding with an atomic nucleus cause pair production?
In the beginning, let's investigate the pair production. We know from relativity that mass can be equivalent to energy and if we set the most important physical constants to one $\hbar = c = \varepsilon = 1$, then we have the following relation (assuming that we produce electron-positron pair):
$$ E = \omega = \gamma_1 m_{e^-} + \gamma_2 m_{e^+} $$
Where $\omega$ is the energy (or the frequency) of the photon and $\gamma$ is the relativistic factor.
In quantum mechanics, the things is, that anything can happen what is possible to happen. But the question is how often it will happen. However, the pair creation in vacuum is not allowed due to momentum conservation. The proof is as follows: we can transfer into a zero momentum energy of the particle-antiparticle pair, but the photon will not have zero momentum, as it can not be at rest.
Now the momentum conservation can be 'fixed' if we have any nuclei around, then they carry the required ammount of momentum, so that the process becomes kinematically allowed.
If that is not enough, could you clarify, what do you mean "behind the scenes"?
UPDATE: Annav has a very good explanation to the 'why' part. I just wanted to emphasize, that it happens, because the process is physically Like annav and twistor59 said, the problem is that the process is physically feasible and that is enough for the quantum mechanical nature of our world to make it happen. So rather than asking why, we should ask how often and and annav's answer shows, that there is a theory called Quantum Electrodynamics, which helps us predict that.
Also, I wanted to note, that although we can have a process where we indeed produce a pair of quarks, in such a process one needs to remmember, that lone quarks have not been observed in our world and this is because of quarks being entirely different 'beasts' than leptons (ie. $e^-$,$e^+$, $\mu^-$,$\mu^+$, $\tau^-$ and $\tau^+$ elementary particles). The quark behaviour is rather well explained by Quantum Chromodynamics, however, the exact mechanism for me is still unknown. All I wanted to say, that the quark-antiquark production case is much more complicated than a lepton-antilepton production case.
This process is the result of the cooperation of two theories of nature:
(i) Special relativity: This is a huge topic to study but we shall only need a small part of it, and perhaps the most famous one, which tells us this
$E=mc^2$.
This equation shows us that matter and energy are equivalent and interchangeable. For example, if an amount of energy $E = 2m_ec^2$ becomes available in a very small region of space, where $m_e$ is equal to the mass of the electron (or positron,) then it is possible to convert it into two particles, the electron and the positron.
(ii) Quantum mechanics: This tells us that electromagnetic waves are represented by “particles called photons,” which carry the energy of the electromagnetic field. The amount of energy carried by a photon is given by the famous equation
$E=hf$ where $h=6.63\times 10^{-34}$Js and $f$ is the frequency of the photon. So if the photon caries the amount of energy $E=2m_ec^2$ as it is emitted by a source (usually $gamma$)-emitter then the following can happen:
As the photon travels in space, QM allows the creation of an electron positron pair which lives only for a very short time, because they annihilate again into the original photon – this process is called “vacuum polarisation.” These two particles exist in virtual states and cannot be separated just like that, as that would violate the principle of conservation of momentum.
However, if an atomic nucleus is near by, then it is possible that a second photon coming from the nucleus can separate the two particles, before they annihilate again to give the original photon that generated them. I.e. the Coulomb field of the nucleus “pushes” the positron away, while it “pulls” the electron towards it. Hence the two particles became real, and can be guided into magnetic fields for storage and further use.
These processes are “behind the scenes” of a pair creation. The part of physics dealing with these fascinating quantum phenomena is called Quantum Electrodynamics.
Expansion: By the paragraph that begins “However, if an atomic…” I mean the following:
Imagine a $\gamma$-photon with sufficient energy approaching an atomic nucleus at a very close range. As the photon creates the $e^--e^+$ pair, the positron is scattered away from the nucleus while the electron flies towards the nucleus, in a virtual state, where it absorbs a virtual photon, effectively interacting with the Coulomb field of the nucleus and gets scattered to a new momentum state. During this process the nucleus carries some of the momentum of the virtual electron away. The presence of the atomic nucleus facilitates the splitting of the pair while the principle of momentum conservation is obeyed.
The answer by @gns-ank covers the kinematics of why. Below I tackle the
Why does a photon "split" into an electron and positron, and not just bounce off the nucleus
in your comment to his answer.
In general physics can answer "why" in a nested way, like russian dolls. In the end, the kernel answer is "because it does". In this case though we are in the middle of the nesting, and we can answer "why".
Photons interact electromagnetically with the field of the nucleus or also sometimes the electrons of the atoms according to well established solutions of the problem using quantum electrodynamics. This theory has been validated very meticulously, and it gives the probability of the photon bouncing off, as well as the probability to make an electron positron pair or a quark antiquark pair etc.
In this buuble chamber picture from the large number of photons passing through at the same time without interacting with the atoms or nuclei, one photon managed to interact with an electron, seen, and create a pair and go on to create a pair with higher energy on a nucleus (which is not seen not having enough momentum in the lab frame). Low probability, but it happened ( could also be a coincidence, two photons, but it does seem to point to the vertex)!
We can then go into "why electromagnetic" which will take us to the standard model that has been validated , and then "why the standard model" and some think it is strings, some have other opinions, but we have reached the current kernel of nesting, and the answer is "because that is the way it is".