They know it in the same way that in English the need to do something is implied:
John knows to swim (when he falls overboard).
There is a default interpretation that implies that he "has to", and any deviation requires other wording.
In Spanish, using a verb as the object of saber expresses an ability, not a knowledge per se:
Juan sabe nadar
John is capable of swimming
This is basically the same meaning as poder except that saber implies some mental mechanics at work in doing the activity, whereas poder lacks that implication. Accordingly, inanimate nouns are rarely the subject of saber (except when it means to taste [like]).
If you want to express that he knows the mechanics/progresses by which something is done, that is, deviating from the standard interpretation, you'll need to specify with extra words:
Juan sabe cómo nadar
John knows how to swim (but may or may not be capable of swimming himself)
The grammar of the last one is actually rather complicated if you try to analyze it too far, but it's quite easy to use in practice so don't shy away from it. Also in practice, you'll rarely be misunderstood if you include the cómo, as generally in conversation, if someone knows how to do something, there's a strong implication that they are capable of doing it too.