Saliva sometimes squirts out of your mouth because it sometimes builds up in glands under the tongue.
When you compress the glands as you yawn or talk, suddenly the saliva is catapulted forward and you spray whatever, or whomever, is in front of you.
Most people find it highly embarrassing.
Some people find it fun and entertaining.
The best way to avoid squirting saliva over everything is to close your mouth, and keep it shut.