The valves have two functions:  To allow the blood to flow through the heart smoothly. To prevent the blood from leaking back against the main flow.