During the climactic finale of Star Wars canon do the novelization’s explanation.

After Star Wars' Queen Pe Amidala (Natalie Portman) convinces the Gungans to provide a distraction for her troops to take back the palace, the amphibian race takes to the battlefield and readies themselves for the Trade Federation’s assault. As they ignite their individual personal energy shields, the command is given to start up the large ray shield that will create a blue dome over the entire Gungan army. The Trade Federation begins to fire upon the dome with its Armored Assault Tanks, but the artillery is no match for the ray shield. At this point, the battle droids are deployed and while their E-5 blaster rifles can’t penetrate the dome, they are able to walk right through it, forcing the Gungans to adjust their tactics.

Related: Star Wars: Clone Wars’ Gungan Cities Are Way More Diverse Than The Movies

The advanced Star Wars: Revenge of the Sith. As the Terry Brooks’ novelization explains:

The Gungan shield wall was designed to deflect large, slow-moving objects of density and mass such as artillery vehicles and small, fast-moving objects generating extreme heat such as projectiles from weapons fire. But it would not deflect small, slow-moving droids—even massed together in such numbers as they were here.” This explains why the battle droids’ blaster rifles were deflected, given that those projectiles are energy-base, generating heat and fast-moving. Similarly, the Armored Assault Tanks’ laser cannons would be unable to break through the shield for this reason as well.

Battle Droids in Star wars

The novel’s explanation appears to be very specific, addressing exactly the situation in The Phantom Menace, but in battle droids in The Phantom Menace most likely could have endured a little zap to their circuits without being destroyed.

The Gungans’ ray shield in Star Wars: The Phantom Menace is an interesting piece of technology that makes more sense when coupled with the explanation provided in Terry Brooks’ novelization. The battle droids bursting through the dome is an unexpected twist that heightens the stakes for the Gungans. Perhaps this scenario convinced the Gungans to use their ray shields in conjunction with particle shields, which deflects physical objects.

More: Gungans Were Actually Deadly 200 Years Before Phantom Menace