Kids are like sponges. Especially at the preschool age, they absorb just about anything they see or hear. Kids are like parrots, too. Often they would repeat just what they hear other people say. My two-year-old daughter, C, is like this. She repeats everything her older sister says. And most of the time, she understands just what is being said–she has quite a wide vocabulary already. Otherwise, she would repeat what has been said and ask, “Dad, what’s that (the thing that had just been uttered).”
Unfortunately, kids can also easily pick up on foul or mature language, whether from other people or from media like television or radio. And things like these are very very difficult to unlearn.
So it pays to be careful with what you say around kids. They can easily imitate. Of course, it helps to know that they probably don’t understand much of what they’re saying (like foul language). But then again, these aren’t very pleasant to the ear, and they might keep on uttering these until they eventually learn the meanings when they grow up a bit.