The second example is likely a 'cheat' because the splash damage would be applied the same frame as the shot hits the centre zergling. For an AI to dodge that it would have to have knowledge of which zergling was going to be hit before it was fired upon. The video creator likely used map triggers to simulate the effect.
As far as I can tell, the AI must be cheating, at the very least to obtain map vision beyond what is available in a match. In order for the zerg AI to observe each tank's turret rotation and predict which zergling it's about to fire on, zerglings have a sight radius of 8, smaller than the tank's 11. In a fair match, the zerglings would be fired on before getting a chance to see the tanks. Even as the group of zerglings gets close enough to see the first tanks, other tanks start firing from beyond the zerglings' vision, so I'm not convinced this AI could pull this off in an actual match.
In the linked video around 1:07, you can see that they already have vision on the tanks when the first one rotates to fire. This could be the result of a cheat, but SC2 does include NPC watchtower buildings that can be captured to grant vision over a large area of the map (you could also send flyers to scout). From there it is (or at least can) 'just' ridiculously fast and precise angle-tracking and micro, so this is a situational tactic at worst.