as alex said,, valve let the air fule mix in,, and the burnt gases out,, the more valve area we have,,, the more we can fill the chamber with our lovely air fuel mix
heres a cool moving gif i found,,, inlet valve is on the right,,, exhaust on the left