First of all, please apologize for any mistakes that I made, English is not my first language.
I have always wondered how wars worked back then, particularly how they started and ended. I know that in medieval and modern times diplomats were assigned to deliver declarations of war, but how did the Romans and the Germanic tribes manage to do that?
The Romans did make declarations of war, but they were religious in nature rather than political.
Early in Rome's history, Rome fought neighbouring cities which had gods similar to the Roman gods. Those foreign gods were often considered to be roughly equal in power to the Roman gods. The Romans undertook elaborate steps to ensure they - and not the enemy - would receive the favour of the gods.
The proces began with the Romans having (or making up) some legitimate cause for war, a grievance of some sort. Before declaring war, they would have a fetial (priest devoted to Jupiter) go to the enemy territory and demand reparations to avoid war. This 'demand for reparations' was essentially blackmail. The demand was non-negotiable and often set at an unacceptably high level. The Romans were simply going through the motions.
The priest would report the enemy's response back to Rome, where a formal decision to declare war or not was made. If it was decided that war should be declared, a fetial would again travel to the enemy territory, this time with magical spear. The at the border of the enemy territory, the fetial would formally declare war and throw the magical spear into the enemy territory.
This proces was rather elaborate, but it ensured that the gods would see the war as a just war and just wars would always end in Roman victory. As I said, it is a religious rather than a political proces, and its effect would have been mostly psychological as the Romans would be assured of divine favour. With this in mind, it is easier to understand the subsequent evolution of this proces.
For as Rome expanded and the enemies would be farther away, the three journeys required for one declaration of war became too much. At some point it became accepted that the final journey could be cut from the proces. The fetials would simply declare a small patch of land near Rome to be 'enemy territory' and throw the magical spear there. Later on another journey was cut by making conditional declarations of war. Bring the spear on the first journey and if the response to the demand for reparations is negative toss it in their territory.
By the Middle Republic the process was a skeleton of its former self. Religous backing wasn't even considered necessary if the enemy wasn't considered particulary daunting or wasn't considered worthy. Gallic and Germanic tribes will often have fallen in that category. At other times, all that remained of the process was the conditional part: A legate (a politician) could go to an enemy to bring the conditional declaration of war, and he wouldn't even have to toss a spear to make anything official.
Main source: W.V. Harris, War and Imperialism in Republican Rome 327-70 BC, Oxford 1979
There was a formal process of declaring war which is described by Livy as follows:
Numa had instituted religious observances for times of peace, he would hand down the ceremonies appropriate to a state of war. In order, therefore, that wars might be not only conducted but also proclaimed with some formality, he wrote down the law, as taken from the ancient nation of the Aequicoli, under which the Fetials act down to this day when seeking redress for injuries. The procedure is as follows: —
The ambassador binds his head in a woollen fillet. When he has reached the frontiers of the nation from whom satisfaction is demanded, he says, ‘Hear, O Jupiter! Hear ye confines’-naming the particular nation whose they are —‘Hear, O Justice! I am the public herald of the Roman People rightly and duly authorised do I come; let confidence be placed in my words.’ Then he recites the terms of the demands and calls Jupiter to witness: ‘If I am demanding the surrender of those men or those goods, contrary to justice and religion, suffer me nevermore to enjoy my native land.’ He repeats these words as he crosses the frontier, he repeats them to whoever happens to be the first person he meets, he repeats them as he enters the gates and again on entering the forum, with some slight changes in the wording of the formula. If what he demands are not surrendered at the expiration of thirty-three days-for that is the fixed period of grace-he declares war in the following terms: ‘Hear, 0 Jupiter, and thou Janus Quirinus, and all ye heavenly gods, and ye, gods of earth and of the lower world, hear me! I call you to witness that this people’ — mentioning it by name — ‘is unjust and does not fulfill its sacred obligations. But about these matters we must consult the elders in our own land in what way we may obtain our rights.’
With these words the ambassador returned to Rome for consultation. The king forthwith consulted the senate in words to the following effect: ‘Concerning the matters suits and causes, whereof the Pater Patratus of the Roman people and Quirites hath complained to the Pater Patratus of the Prisci Latini, and to the people of the Prisci Latini which matters they were bound severally to surrender, discharge, and make good, whereas they have done none of these things —say what is your opinion?’ He whose opinion was first asked, replied, ‘I am of opinion that they ought to be recovered by a just and righteous war, wherefore I give my consent and vote for it.’ Then the others were asked in order, and when the majority of those present declared themselves of the same opinion, war was agreed upon. It was customary for the Fetial to carry to the enemies' frontiers a blood-smeared spear tipped with iron or burnt at the end, and, in the presence of at least three adults, to say, ‘Inasmuch as the peoples of the Prisci Latini have been guilty of wrong against the People of Rome and the Quirites, and inasmuch as the People of Rome and the Quirites have ordered that there be war with the Prisci Latini, and the Senate of the People of Rome and the Quirites have determined and decreed that there shall be war with the Prisci Latini, therefore I and the People of Rome, declare and make war upon the peoples of the Prisci Latini.’ With these words he hurled his spear into their territory. This was the way in which at that time satisfaction was demanded from the Latins and war declared, and posterity adopted the custom.
(link)
However, this form of declaring war was - if really as ancient as claimed - already obsolete by the mid-Republic with war being declared by way of senatorial embassies, not the Fetial priests. Octavian revived (or invented) the custom in 32 BC - now with the lance being thrown before the temple of Bellona in Rome.
Thomas Wiedemann's The Fetiales: A Reconsideration is a short and interesting overview (available on JSTOR) that argues in favor of the Fetiales traditionally having only been concerned with the validity of treaties and their role in declarations of war quite possibly being an innovation by Octavian (maybe inspired by similar practices in Greece).