Of course, the bow string does not know when to attach and release a violin string, it is the choice of materials which dictates this.

When viewed under a microscope it is possible to see the tiny barbs on the surface of each hair which in themselves do not make the string vibrate. The addition of rosin, which is sticky, to the bow hair increases friction between the bow hair and the strings on the instrument causing the strings to vibrate as the bow hair is drawn across the surface of the strings.
Now to (partially) answering the question,
How do the strings know when to catch the bow, and when to release
them?
As you might expect the answer is complex, but I will try and give you an idea of what happens.
Helmholtz, after observing the motion of strings with a vibration microscope discovered that the motion of the string could be described by a sharp corner, traveling back and forth on the string along a parabola-shaped path.
The fundamental period of vibration $T$ is determined by the time it takes for the corner to make a single round trip.

Imagine a triangular wave travelling along the string and then being reflected at the ends.
At the bowing position the bow velocity is $v_{\rm B}$ and the string has two velocities, $v_+$, when no slipping occurs (the bow sticks to the string) and so $v_+=v_{\rm B}$, and $v_-$ when there is slipping between the bow and the string.
It is the movement of the travelling corner along the string which synchronizes the slipping and sticking phases and is the reason,
We don't hear a discontinuous noise from a violin; rather we hear
smooth continuous notes.
Referring to the diagrams and graphs above, the left hand diagram has a sequence of sharp corner wave profiles ("photographs" of the string at various instances of time) with the bow at position $x_{\rm B}$ travelling with velocity $v_{\rm B}$ and the middle of the string at position $x_{\rm M}$.
The graphs on the right hand side at graphs of string displacement and string velocity as a function of time at the bowing position (b) where the string velocity is either equal to the bow velocity, $v_+=v_{\rm B}$ or the string is slipping relative to the bow, $v_-=v_{\rm S}$.
At the middle, $x=x_{\rm M}$ the $v+$ and $v_-$ just represent the string velocities which on this simplistic model means that the position of bowing has no effect.
This analysis assumes no losses and ignores the stiffness of the sting and the role of the bow force all of which which require more sophisticated models resulting in rounded corners and resharpened corners.
As a late addition to my answer I have "borrowed" @Quantumwhisp's excellent gif,

and the link to the article Science and the Stradivarius in Physics World.
I hope they do not mind.