The LLM is deciding to use that skill at that time. The skill itself was trained beforehand by the user like shown in the docs, and the agent has information about what kind of context the task can be used in and recognizes that here is the right moment
EDIT: I say LLM but it's really not just an LLM. From the outside perspective it looks like it because we decided to do so, but under the hood it's multiple models (as described in the post)