Final answer:
The AV valves open when the atria and ventricles are relaxed or when the atria contract, allowing blood to flow into the ventricles, while the semilunar valves open when the ventricles contract, letting blood flow into the aorta and pulmonary trunk.
Step-by-step explanation:
The functioning of the atrioventricular (AV) valves and the semilunar valves in the heart is a part of the cardiac cycle, which ensures proper blood flow through the ventricular system. During the cardiac cycle, the AV valves open when both atria and ventricles are relaxed (diastole) and when the atria contract, allowing blood to flow from the atria into the ventricles. Conversely, when the ventricles contract during systole, the AV valves close to prevent backflow into the atria, and the semilunar valves open, allowing blood to be ejected into the pulmonary trunk and aorta.
In the early phase of ventricular diastole, the semilunar valves close to prevent backflow from the aorta and pulmonary trunk into the ventricles, and the pressure within the ventricles begins to drop. When this pressure drops below that in the atria, the AV valves open, allowing blood to flow freely into the ventricles, completing the cycle.