To expand on Joel's answer, you would be able to determine the correct cantillation by determining where to place the divisions and subdivisions within the verse, and once you have the divisions, there are rules determining what goes around them. (This isn't to say there is one objective way of determining where the divisions are.)
To take the verse you gave as an example to show how the cantillation was determined:
וַיֵּחָלֵק עֲלֵיהֶם לַיְלָה הוּא וַעֲבָדָיו וַיַּכֵּם וַיִּרְדְּפֵם עַד-חוֹבָה אֲשֶׁר מִשְּׂמֹאל לְדַמָּשֶׂק
And he chased after them by night, he and his servants, and he struck them; and he chased them until Hobah, which is north of Damascus
You would start by dividing the verse into two sections, which the te'amim do at the word וַיַּכֵּם, and so the etnachta is placed on וַיַּכֵּם. Now we would have to divide the two halves of the verse into further subdivisions, working backwards from each half of the verse:
וַיֵּחָלֵק עֲלֵיהֶם לַיְלָה הוּא וַעֲבָדָיו וַיַּכֵּ֑ם
The last division here is at the word וַעֲבָדָיו, and so the greatest available ta'am is used to separate it from וַיַּכֵּ֑ם, the tippecha. (The tippecha is always the last pause before an etnachta, and always comes either one or two words before the etnachta.)
The previous division (since we are working backwards) is לַיְלָה. If it were a greater division than וַעֲבָדָיו it would deserve a zakef katan (or its equivalent); however, since it is more of a subdivision of the phrase וַיֵּחָלֵק עֲלֵיהֶם לַיְלָה, הוּא וַעֲבָדָיו than its own phrase, it gets the next rank, which is (always before a tippecha) the tevir.
At this point, since there are no more divisions, we only have to use the filler cantillation ("servants") that don't divide, which is automatic: Before a tippecha we put a mercha; before a tevir we put a darga,1 and before a darga we put a kadma.2
וַיֵּחָלֵ֨ק עֲלֵיהֶ֧ם ׀ לַ֛יְלָה ה֥וּא וַעֲבָדָ֖יו וַיַּכֵּ֑ם
For the second half:
וַיִּרְדְּפֵם עַד־חוֹבָה אֲשֶׁר מִשְּׂמֹאל לְדַמָּשֶׂק
Once again, working backwards, we know there has to be a tippecha on either מִשְּׂמֹאל or אֲשֶׁר. Since מִשְּׂמֹאל is a greater division, the tippecha goes there. Now we have to continue backwards until the next division, which is חוֹבָה, and thus gets a zakef katan. Continuing to work backwards, וַיִּרְדְּפֵם is a subdivision of the phrase וַיִּרְדְּפֵם עַד־חוֹבָה and so it gets a pashta for being before a zakef katan. (It would have gotten a munach if we had instead decided it wasn't a division.) Now the only servant to add here is a mercha before the tippecha, which gives the full verse:
וַיֵּחָלֵ֨ק עֲלֵיהֶ֧ם ׀ לַ֛יְלָה ה֥וּא וַעֲבָדָ֖יו וַיַּכֵּ֑ם וַֽיִּרְדְּפֵם֙ עַד־חוֹבָ֔ה אֲשֶׁ֥ר מִשְּׂמֹ֖אל לְדַמָּֽשֶׂק׃
This was a short verse, but the same type of rules apply to longer verses too. Given where to place the divisions (such as by using Mechon Mamre's punctuation), and given their levels, you would be able to predict with reasonable accuracy how to punctuate this verse as well:
וַיֹּ֗אמֶר צֵ֣א וְעָמַדְתָּ֣ בָהָר֮ לִפְנֵ֣י יְהֹוָה֒ וְהִנֵּ֧ה יְהֹוָ֣ה עֹבֵ֗ר וְר֣וּחַ גְּדוֹלָ֡ה וְחָזָ֞ק מְפָרֵק֩ הָרִ֨ים וּמְשַׁבֵּ֤ר סְלָעִים֙ לִפְנֵ֣י יְהֹוָ֔ה לֹ֥א בָר֖וּחַ יְהֹוָ֑ה וְאַחַ֤ר הָר֙וּחַ֙ רַ֔עַשׁ לֹ֥א בָרַ֖עַשׁ יְהֹוָֽה׃
To learn these methods, there are books written on the subject (Joel pointed to one of them), but Wikipedia is a good starting point.
Despite the predictability, the te'amim are themselves a subjective interpretation of the verse, and there are times when they seem to change the plain meaning for theological reasons (e.g. to avoid saying seraphs stand above God at Isaiah 6:2, to avoid calling human God at Ezekiel 28:14, to change "gods" to "God" at Psalms 36:8) or just give other possible readings (Psalms 73:8 could have been read differently), or are simply mystifying (I have yet to understand the te'amim on Isaiah 12:2).
1 It really should be a mercha, since a darga is only used when there are 2 intervening syllables between the two stressed syllables, but the darga is apparently used here because there is a pasek after עֲלֵיהֶם. I'm not going into when to use a pasek.
2 A kadma is a special case of a munach before certain other te'amim that is used when the word isn't stressed on its first syllable.