After the liberation of Astapor, Dany's host marched north along the coast, towards the coastal city of Yunkai. The road distance was about 320 miles (515 km) (1). However, about 9 miles (~15 km) from the city they encountered a Yunkish slave army, supported by two mounted sellsword companies: The Stormcrows (on the Yunkish left) and the Second Sons (Yunkish right). Each of the sellsword companies numbered about 500 men, and the total strength was estimated to be 5.000 men. Dany's army was superior, both numerically and qualitatively, and numbered several thousand armed freedmen (2) and a few dozen mounted Dothraki, in addition to her 8.600 fully trained Unsullied. But the freedmen were untrained and lightly armed, in stark contrast to the heavy elite battalions of the Unsullied. Dany's host also consisted of tens of thousands of kids and women and other non-combatants.
Dany decided to negotiate with the slavers and captains of the sellswords, hoping to turn the sellsword over to her side and lure the Wise Masters of Yunkai to release the city slaves. The captains of the Stormcrows, Prendahl na Ghezn, Sallor the Bald and Daario Naharis, are invited to her tent, but her offers are recjected by their spokesman, Prendahl. Mero, the captain of the Second Sons admitted that she's worth fighting for, and after Dany gave him a wagon of wine he promised to bring her an answer next morning. The envoys from Yunkai, led by Grazdan mo Eraz, were enraged by her terms which said that the Wise Masters were to open the city gates in three days, release the slaves and let her enter the city. Nonetheless they brought her terms back to Yunkai.
After dark had fallen, Dany revealed to her commanders that she wanted them to attack the enemy host an hour past midnight. She had planned all along to take the enemy by surprise, and she hoped that the Second Sons would be drunk on the wine she gave Mero. The battle plan was outlined by Dany herself: A surprise attack on both enemy flanks by the Unsullied, led by Grey Worm, their captain, and Ser Jorah Mormont, the supreme commander of the army. Her kos, Jhogo, Aggo and Rakharo were to lead her mounted warriors of about 30 men in wedge formation against the enemy center. Arstan Whitebeard and Strong Belwas were held back to guard her pavilion during the battle (3). The practical details of the plan were worked out in an hour.
Near midnight the Unsullied caught Daario Naharis approaching the camp and it turned out that he had killed the other captains and he surrendered the Stormcrows over to her. He pledged his sword and Dany accepted, aware that she risked being betrayed. Before he returned to his men, he was told to attack the Yunkish in the rear when the attack began. Dany hoped that the hundreds of campfires would distract the enemy scouts, and thus give her men the element of surprise. Jhogo's riders would also take care of any scouts who put their plans in jeopardy.
The attack was launched a few hours after midnight, and the Stormcrows attacked the enemy in the rear, as promised. The Second Sons were too drunk to fight and were unable to support the slave army. Surrounded from all directions, the Yunkish troops broke and threw down their weapons, while the sellswords yielded.
Almost 200 Yunkish infantry were killed, and the rest were taken captive. The Second Sons only suffered light casualties (4), but their captain had fled when he realized that the Stormcrows had betrayed them. Dany's own losses were minimal, only a dozen men had been killed or wounded. The battle had lasted for a few hours.
Dany's host headed for Yunkai the next day, and the army was deployed when they arrived before the city walls. On the morning of the third day the gates were opened and tens of thousands of slaves were set free. The city had been liberated without further confrontations.
Our knowledge about the actual battle is quite limited, so for the sake of discussion we will have to fill in holes by making assumptions and 'educated' guesses.
My first comment concerns Dany's outline of the battle: We know that Dany had limited knowledge about warfare (after all, she's only a 14-15 year old girl), but nonetheless she outlined a rough tactical plan which her captains did not hesitate to accept. She used terms such as 'left', 'right' and 'center', which suggest that her outline was based on the assumption that the enemy forces would be arrayed in some kind of linear formation. It also implies that she's familiar with the local terrain and topography. Because if the enemy camp had been protected by natural obstacles (by the coast, a mountain or a river for example), Dany's outline would not make any sense and her captains would certainly have told her so. She also seems to realize her own limitations when it comes to warfare and that the implementation of military operations are better left over to her experienced captains.
It is hard to say for sure whether the enemy had sought refuge or if they were still positioned on the open fields, but it can be argued that they probably did not seek refuge in a forest or nearby camp during the night, because the book does not mention any such significant movements, and the slave army most likely did not know how to construct field fortifications. If they were still in battle order, they certainly remained on the open field, and it would make it harder for Dany's army to take them by surprise. Their cavalry would benefit from a plain, open field, but topographically it would not offer their army a strong defensive position. And lack of sleep and fatigue would have affected their combat efficiency next day, if it had come to that. They could also have made camp 'on the spot', and the relative positions between the slave army and the cavalry would remain the same as it had been earlier that day, when Dany assessed their numerical strength.
In other words, whether the enemy had bivouacked or not, a cavalry company was probably positioned on each Yunkish wing to protect against flank attacks. Using cavalry to protect the flanks is quite typical from a historical point of view. Dany's army, on the other hand, was probably positioned behind, in or close to the outskirts of a forest, because she had ridden through a birchwood forest and to the crest of a sandstone ridge when she had assessed the enemy forces. Her Unsullied had also taken proper precautions by constructing camp fortifications to protect Dany's host against cavalry charges or surprise attacks. This fortified camp would also be useful if they had to retreat from battle.
The distance between Dany's camp and the Yunkish army was probably several miles: It would be too risky to camp her non-combatants closer to the battlefield. There was probably no direct line-of-sight between Dany's camp and the Yunkish host, due to the ridge and the forest, but both armies had each other under observation through scouts and minor detachments. The ridge was under Dany's control so her men had a good overview of the battlefield from there. Dany's front was in other words much closer to the Yunkish main body.
Somehow Dany's thousands of men managed to move up along the enemy flanks and launch a surprise attack. One possible explanation could be that large detachments were sent in a turning- or wide, double flanking movement. A wide flanking maneuver towards the west (on the Yunkish right wing) would only have been possible if the field was located at least a few miles off the coast. Many smaller detachments might already have been put into position along the enemy flanks, in full sight of the Yunkish host. Their purpose might have been to start camp fires and make a clamour to screen the movements of the major detachments later that night. If there was a forest on the Yunkish left wing, it would have provided additional cover for Dany's troops. A minor body would remain at the fortified camp as a precaution against sudden enemy attacks.
How many of Dany's troops were actually directly involved in the battle? All her mounted Dothraki and the Stormcrows were certainly involved. A vast majority of the fully trained Unsullied were probably involved as well. The armed freedmen were probably held back as reserves closer to the camp. The actual battle might have unfolded as follows: When the signal was given, the Dothraki cavalry rode down the ridge and attacked the Yunkish front, while the Unsullied closed in on their wings, where the sellsword cavalries were positioned. The Stormcrows then attacked the Yunkish infantry from the rear (after they went over to Dany's side they might have positioned themselves slightly to their rear). The Unsullied might have charged or simply marched in their typical phalanx or cohort-order, but it depended on how the situation unfolded: If the Stormcrows, for example, had betrayed Dany, it would be risky to charge their cavalry wing.
Anyway, the safest solution would have been to attack in an orderly fashion. Even if the slow approach of the Unsullied or the faster charge of Dothraki cavalry did not take the Yunkish by surprise, the rear-attack by the Stormcrows certainly did. In all likelihood, large parts of the Yunkish infantry were thrown into a disorganised mess even before Dany's men got into contact with the Yunkish force. The Second Sons were drunk and they probably did not realize what was happening until it was far too late: Many of them were undoubtedly unmounted or asleep when the attack came. Their fighting capability as a cavalry had been severely reduced.
Dany's plan made common sense and the battle turned out to be a success: The basic idea behind her plan was to let the heavy mass of Unsullied handle the sellswords on the flanks, while the Dothraki attacked the fragile slave soldiers. She deceived her foes, took the initiative, exploited her numerical superiority and took them by surprise. But her plan involved certain calculated risks: Trying to direct a battle involving thousands of men at night can be very difficult, it can easily turn into a mess, and the danger of sudden panic is always present. That is probably why her armed freedmen were held back: Their lack of discipline and lack of fighting skills could easily backfire. The Unsullied, on the other hand, were very disciplined and they were also trained in night-maneuvers.
The outcome was successful thanks to her skilled captains and commander Ser Jorah Mormont: It is one thing to figure out a theoretical, tactical plan, but executing that plan at night is an entirely different matter. Most of the battle-maneuvers were probably preplanned, because after the forces had been committed, it would be difficult, if not impossible to redirect or control formations or any reserves in the dark. We also know that Jorah himself participated in the battle, making it even harder to get a better overview of the battlefield, than if he had been 'leading from the rear'.
While Dany outlined her plan, she argued that the Yunkish infantry would not stand before mounted Dothraki. The only hitch here is that her Dothraki only numbered a couple of dozen cavalry, while the slave soldiers numbered about 4.000. And as far as I know most of these mounted Dothraki were light-cavalry, less suitable for shock-action. A better solution might have been to support their attack using a body of a few thousand Unsullied. Such a heavy mass of Unsullied would press the slave soldiers backwards and probably break their front upon impact (if they had not already started to flee at the mere sight of Unsullied marching towards them...). After Daario offered her the Stormcrows, she could also have put the Dothraki on the flanking force to her left to provide greater mobility to their attack on the remains of the Second Sons.
The Stormcrows represented a calculated risk: what could have happened if the Stromcrows deceived Dany? The outcome would hardly have changed, but the battle would certainly have been harder. The slave soldiers would have broken anyway, and the Stormcrows would eventually have been surrounded by several thousand Unsullied. If they had been confronted by a single front, they could have tried outflanking it, but now they were faced with several fronts from several directions, restricting their mobility and pressing them on the defensive (from a historical standpoint, formed heavy infantry could resist the charge of heavy cavalry). Their only escape route would have been towards their rear and back to the city.
As for the casualty rates, they seem to make sense: Prior to the battle, Dany's captains were told to spare any fleeing slave soldier. The Yunkish force lost almost 200 men, which means that they had at least put up a fight, if only for a brief time. Statistically, their total casualty rate was at least twice that figure but nonetheless significantly lower than usual given their hopeless situation (their casualty rate represented 'only' 10% of the total infantry force). But even with over 400 dead and wounded, they should have considered themselves lucky: Only the cover of darkness and Dany's 'restraints' prevented them from being annihilated.
In fact, I believe it was a lost cause to offer Dany battle with such an inferior force in the first place. The Wise Masters, who had probably vastly underestimated Dany's military strength, should have let her try to lay siege on the city and then wait for relievement forces. Even if there were no such forces, Dany's large host would start to starve long before the city did unless she established supply lines, because the city could be supplied by ships from the seaside. Dany's host could have been supplied from the seaside as well, at least for a longer period, using her merchant ships. The nearby river could sustain the needs for water, but for the Yunkai'i a defensive, fortified stance would be better than challenging Dany in open battle.
Moving a host consisting of tens of thousands of combatants and non-combatants over 500 km could represent a logistic nightmare. But they could sustain themselves on the presumably rich agriculture and fertile lands along the coastal route between the two cities. The main road, which constituted a trade route between the cities, was probably highly developed, making the march easier and faster. And her merchant ships could supply her from point to point along the coast. In addition, she could probably purchase extra food and supplies in the smaller towns along the (probably densely settled) trade-route.
What about the strategic importance of liberating Yunkai, except freeing the slaves? To my knowledge, Dany never explicitly provided any other reason than freeing the slaves. Perhaps she was told by Jorah to move in that direction for some reason? But the freedmen could be useful if they decided to join her cause and support her militarily. These 'fresh' freedmen could come in handy later as trained light infantry or skirmishers, complementing her heavy infantry and reinforcing her army. And the craftsmen would prove useful for supporting the needs of her host and perhaps offer her advice. Of course, freeing the city would also present her with the opportunity to get hold of valuable treasure, food, supplies and equipment. Thus, in the end, the liberation of Yunkai would serve her long-term goals of invading Westeros. Another explanation could simply be that she didn't expect any resistance along the way, and that the liberation of the slaves wasn't pre-planned, although it sounds less convincing to me. When she encountered the Yunkish force, she might also have felt that there was no way back.
(1): This figure is based on their relative map-positions and the estimated distance between Yunkai and Meereen.
(2): "... tens of thousands preferred to follow her to Yunkai ...", "... but only one in ten was strong enough to fight, and none was trained...", Dany (3p475).
(3): Of course, her camp was protected by regular troops as well (see General Notes for details). Arstan and Belwas only represented her 'inner perimeter' defense.
(4): "... Two hundred dead, Yunkai'i for the most part.", Jorah (3p487).