The first heart sound (S1) is closure of the valve at the end of ventricular filling (the tricuspid and mitral valves); the second heart sound (S2), is closure of the aortic and/or the pulmonary valves as the ventricles relax.
Extra sounds, (third and/or fourth heart sound, can be normal, especially in children, or with severe exercise, but are generally heard (on the left side) when ventricular function is impaired, e.g., in case of acute infarction or severe cardiac failure.
The sounds are thought to be caused by the atrium, facing back-pressure, forcing volume into an incompletely emptied ventricle.
With right-sided back pressure after pulmonary embolism, and therefore an incompletely emptied right ventricle, a right-sided gallop can occur.
Gallop rhythms may be heard in young or athletic people, but may also be a sign of serious cardiac problems like heart failure as well as pulmonary edema.