How do valves in the heart and blood vessels work?

How do valves in the body basically work. I can understand how blood flowing on either direction can close or open valves depending on the type of valve. But someone told me it is the elastic recoil of the veins that closes the valve. I thought it would blood that was going back that closed the valve. Also in the heart does the contraction of right ventricle close the mitral valve or the blood going back from the ventricle that closes the valve.

Also while we are at it. I read that aortic valve closes before pulmonary valve in a text book. The reason was this in the text book

"Aortic valve closes before the closure of pulmonary valve because of the lower impedance of the pulmonary vasculature"