The question says it all.
Pleaselog inorregisterto add a comment.
It’s partially based off trees, according toBulbapedia. Lightning is attracted to trees, explained briefly here:
Trees attract lightning because they provide a path for lightning to travel from the storm cloud to the earth.
Source
Lightning rods are also intended to attract lightning. Any electricity sent towards Mega Sceptile is very likely just attracted to the tree part of it, rendering the Sceptile itself immune to Electric attacks.
From a gameplay perspective, Game Freak may have just wanted to give Mega Sceptile a potentially decent Ability in Doubles.
Hope I helped!
Oh, Found it!
Trees attract lightening. The larger the tree, the greater the propensity to be struck. Given Sceptile now has a large tree-like tail, I think Gamefreak wanted to illlustrate how large the tree like structure is, as well as giving it a nice competitive ability.
Source