I can speak to the practice during Roman times. The mural crown or corona muralis was a gold crown fashioned to look like crenelations used as a military award (think up there with the US Medal of Honor, or Britain’s Victoria Cross) by the Romans. This was awarded to the first legionary to scale the walls, overcome defenders in his path, and successfully mount the battlements.
Usually, this would be the centurion of a unit, who would solicit the help of the legionaries under his command to support his ascent, by helping set the ladder, flinging missiles at the defenders on the battlements, and following him up to help push the defenders from the walls to secure the award, etc. The centurion would undoubtedly distribute some of financial rewards to those that assisted them, and the prestige of being part of the “team” that won the mural crown was likely very significant even if you weren’t the direct recipient.
As far as motivation, besides a monetary award that likely accompanied the decoration, an award such as the corona muralis would confer a level of status and prestige hard to relate to today. In a society so enthralled with military virtue and accomplishment, being awarded the mural crown of would make you a high-profile celebrity, likely conferred a sizable financial award as previously mentioned, and had the very real possibility of launching a aspiring politician’s career to the highest levels of office. It is important to remember that Rome’s commanders and Rome’s politicians were the same elite group of senators or equites (“knights”), underlining the intrinsic relation between military and political success in Roman society. They also had a strong Homeric ethic, meaning individual accomplishments of valour and prowess on the battlefield were celebrated alongside strategic or tactical victories on the part of a victorious general.
The Romans also practiced a fanatical form of ancestor worship, with wax “death masks” of their ancestors prominently displayed in a public area of the house alongside their respective accomplishments. Being elected to the highest office would permanently give a family the elevated social status of the nobiles (nobles) which would serve as a significant source of pride and status for future generations. Along the same lines, having an ancestor (even distant) who won the corona muralis would be something the recipient’s great, great, great grandson could lord over his peers in a socially significant way. EDIT: The Romans also believed that virtue and capacity for accomplishment was passed from father to son through the generations, albeit without understanding modern genetics.
Tiberius Gracchus, the elder of the famous populare Gracchi brothers, was awarded the corona muralis for being the first one to scale the walls during the sack of Carthage during the Third Punic War. A similarly prestige award, the corona civitas or “Civic Crown”, was awarded to Julius Caesar for saving the life of a fellow citizen in battle and holding the ground afterwards, and was considered to be one of the greatest accomplishments of his career, which is saying something.
Additionally, the Romans almost never gave posthumous military decorations, and we hear about the mural crown being awarded often enough that it seems relatively common. In theory, any time the Romans took a city by storm, one would be awarded (after a lengthy and thorough litigation of who made it to the top first. Roman military awards were a serious business), and given Rome conquered the entire Mediterranean world, cities were taken by storm aplenty. Additionally, while still extremely dangerous, once a battle or siege started to go in one side’s direction, it tended to be fairly one-sided in terms of casualties, meaning that if you could successfully mount the battlements with enough of your comrades to secure the foothold, you had a reasonable expectation of survival.
To sum it up, with our modern frame of reference, it is hard to conceptualize just how much importance cultures in antiquity placed on military accomplishments, the Romans even more so than typically found. It would be as if a Medal of Honor recipient was automatically given the starring role in a blockbuster movie featuring their own exploits, won the lottery, and was an immediate frontrunner for the next Presidential election. So while the risks were immense, success would mean near-godlike status, not to mention the possibility of wealth and political advancement for your family for generations to come.