When a unit is "surrounded", what benefits does this give to the surrounding party?
Solution 1:
No there are no special bonuses. Surrounding is just an effective tactic in some situations.
In your example you have Zerglings surrounding a single marauder. I haven't played in a while but to surround a marauder with Zerglings you will probably need about 6-8 zerglings. This means you have 6(+) zerglings attacking at the same time whereas only one marauder attacking. Now take an example where a marauder is in a gap, say between two buildings. Only 3 or so zerglings will be able to attack the marauder at once. So you're now doing less than half the damage as when you were surrounding them.
The other thing that surrounding does is that it prevents the marauder from retreating and/or kiting. Ground units cannot move through other ground units, so surrounding units block movement in their direction. A kiting unit such as a marauder (has effective kiting with stim and slow) is going to do a lot more damage than if it just stood still. Not to mention that if the unit you're attacking is retreating and you chase too far, you could end up encountering the enemy reinforcements. You will often see a group of zerglings run past the enemy, taking additional hits, just so that when they attack, they have surrounded or partially surrounded the side that they would like to escape from.
Now another situation, where there is a large cluster of ranged units, say marines. You do not want to surround this with zerglings for much the same reason you want to surround a small number of units; the number of units that can attack at once is more for the marines than the zerglings. Knowing when a marine ball is too large to surround will take experience.
Now I guess the final case would be ranged units vs ranged units. Again this is going to be beneficial to the surrounding units as it allows more units to attack at once. However if the surround is too thin, then the army being surrounded can kite towards one side of the surround, breaking through and preventing half the surrounding circle from being able to attack.
Generally full surrounds don't happen with ranged units vs. ranged units, the more common situation is an arc. Which is basically the same thing, it's essentially just a partial surround. This is hugely important in fights especially in ZvZ, you'll hear about the roach(/hydra) arc a lot. But it comes down to the same thing, if you an army of 30 vs 30 like units, than if 12 of the former can attack at once whereas only 10 of the latter can attack at once then obviously the former will win. This 'number of units attacking at a time' can overcome upgrade and unit count disadvantages.
Feel free to comment below any questions or clarifications you'd like to ask for.
Solution 2:
"Surrounding" is just a type of micro (micro is optimizing your army unit's attack and defense by controlling them well) that works well for your melee ground units. It spreads them out in such a way that the maximum number possible are attacking the target at the same time. It also prevents the attacked units from using certain types of micro (stutter step, kiting) or retreating.
The corresponding type of micro that works well for your ranged ground units is the "concave" (spreading your ranged attack units out so that they make a crescent shape) and also moving them forward far enough that any ranged units in the back row can also fire.
A type of micro that works well for both types of units is "flanking" (attacking from multiple directions at once).