The key is to look for a relative pronoun such as which.
We are comparing these two patterns
The X is a, b, and c
The X is a, which b
In your example you are asking how we know that "sits ..." tells us more about process rather than your main function.
In technical terminology you are asking how we can identify a non-restrictive relative clause. The two identifiers are
- a preceding comma
- the use of which (or other relative pronouns such as who)
The driver process runs your main() function, sits on a node in the cluster
No which, so we are learning more about the driver process
The driver process runs your main() function, which you have developed
Here we have a which. So this is a non-restrictive relative clause, which gives us more information about the main() function.
For comparison, there is also the possibility of a restrictive relative clause. This has no preceding comma and often uses that. A restrictive clause is essential to the meaning of the sentence.
Rugby is a game that is played with an oval ball.
There are some differences between US and UK uses of that and which and you can read more about this in articles such as this one.