Normally, rapid-fire are far superior combat units, and are generally the ideal pick (especially with mortar AoE seemingly taking a hit).  However, their fast-firing attacks can generate a lot of lag, and are, in turn, hindered by low frame-rates.  This makes the typically slightly less efficient mortars much more powerful when spammed in situations where there will be a large number of enemies on-screen, or the size of your army is over a threshold that generates lag, as their attacks seem to be relatively unaffected compared to the impact on rapid-fire. 

I would recommend you test, using the battle simulator, how many ants there needs to be before the game is slowed down enough that mortars are more effective. 

My understanding of what causes this is that the game handles it like this: 

Every 0.5 seconds, rapid-fire can attack. 
Every 3 seconds, mortars can attack. 
If the game checks for and performs an available attack every 0.1 seconds, rapid-fire will be stronger.  A maximum of a 0.1 second delay allows rapid-fire to waste very little time, while mortar also waste very little time, with an attack ratio of 6 to 1. 
If the game checks for and performs an available attack only every 1 seconds due to lag, mortars will still attack about the same rate with a maximum of a 1 second delay, while rapid-fire at a maximum of 1 second delay will have that same delay far more often, allowing an attack ratio as awful as 4 to 1.  Longer delays will only make this worse (a 2 second delay can make the comparative ratio as bad as 5 to 2)

Since rapid-fire have such small damage packets, they rely entirely on getting those packets off quickly.  Lag prevents this from happening, making the single large damage packets of mortars much more reliable. 
« Last Edit: July 12, 2018, 04:16:01 PM by Rayalot72 »
And on the sixth day, God created ant in his own image, and gave them dominion over the earth and all of its creatures.  Amen.

That's probably why I can't see any rapid fire beating mortar I've try even 100 rapid fire against 50 mortars each lvl1 and then lvl2 and then lvl3 mortars olways win with around of five looses I've beaten insane of each wood ant levels always with mortars but I have never been able to beat them with rapid fire
In the game of ants, you play or you die.