How do open source companies avoid harmful contributions and find the useful ones?

Because wikipedia is open source, I can modify anything I want. But what happens if someone deletes, adds bad content, modifies useful content ? What does wikipedia do to prevent that ?

The last question is available for any other open source software: linux, php etc. How do they know which contribution is useful and which is harmful ?
Thank you.