While he never showed the ability to use Force lightning before, it's appearance here helps communicate Kylo Ren's shift in his allegiance, and it's presently the only canon instance of Kylo using such an ability.
Vader relies on the complex life support system of his suit to survive and it happens to be very vulnerable to electrical discharges. So, if Vader ever had unleashed Force lightning, there's a good chance it would've caused his suit to short circuit, thus, killing him.
Force lightning ability was not restricted to dark-siders. Jedi and other light-siders who were strong of will and character could learn this power without falling to the dark side—but its use was viewed as inherently corrupting, and most Jedi Councils forbade its use.
He hadn't learned it yet. Also you can't use Sith Lightning until you yourself are hit with it which he never was until after dawning his suit, but as someone else has mentioned, he was unable to use it due to his cybernetics.
Obi-Wan knew Anakin through and through and understood his overconfidence and arrogance. He knew Anakin would fight with rage and aggression, while he remained cool and calculated. Pairing his understanding of Anakin with his knowledge of Soresu ultimately gave him the upper hand in the battle.
1 Darth Sidious
As well as being a gifted bladesman Sidious' connection to the Dark Side is extremely powerful, granting Sidious the ability to conduct force lightning.
Let's be honest - it's not as if Yoda is going to have forgotten about that time back on Coruscant where Palpatine nearly fried him with lightning, so the logical answer seems to be that he didn't want to distract Luke with anything such as "watch out for this, that and the other" - he reminds Luke that the Emperor is ...
Through his duels with Darth Sidious and Count Dooku, it was well known that Yoda could absorb and deflect Force lightning with his palms. However, Yoda's ability as a Force ghost to summon lightning and use it to strike the material world was an ability kept hidden until The Last Jedi.
Legends Canon: Yes he has. What he used was a variant of force lightning called “Emerald Lightning” which is supposed to be similar to Plo Koon's “Electric Judgement”.
Gray Jedi commonly demonstrated their skills with both Light and Dark side Force capabilities. For example, the capacity to construct a lightsaber from scratch, along with unique Force talents such as Force lightning.
Given Rey's lineage as Palpatine's granddaughter, it is also reasonable to assume she is already better attuned to using Force Lightning than the average Force user, with Ben telling Rey that she has all of Palpatine's power within her at the beginning of The Rise of Skywalker.
Over the decades, For lightning has become strongly associated with the Sith. Palpatine is particularly fond of this power, using it to most spectacular effect in Star Wars: The Rise of Skywalker.
Sith Assassins leap from the shadows, channeling Force Lightning through their double-bladed lightsabers to disable and drain their enemies. They are masters of subterfuge, feared by even the most terrible opponents.
Master Yoda has risen above all others to claim the top spot as the most powerful Jedi of all time and the true chosen one according to IGN's audience. He won pretty handily as well, as he was victorious in 89,756 of his 95,243 battles and had a win percentage of 94.2%.
It's the intensity of reflected lightning and the channelling of such raw dark side power that are the catalysts for Palpatine's transformation. Perhaps the face that boils up to the surface is shaped by his dark side corruption, but the lightning is definitely the cause.”
The true Force-form of Darth Vader explains why he can't use Force Lightning. Conceived by the will of the Force itself, and with a midi-chlorian count so high it was greater than even Master Yoda's, Anakin Skywalker was the greatest Jedi Knight of his generation.
However, despite their strict adherence to the light side of the Force, several Jedi were known to use this power, as although it was considered a dark side ability, it was also a technique of telekinesis. Its use, however, was forbidden by the Jedi.
After, he regretted not killing him and wondered if he had only made things worse by pushing Anakin further into dark side and Palpatine's arms. As I said, Obi-wan's regrets are layered and they involve everything that happened in his life.
David Porter provides some great philosophical context to why Obi-Wan would not regret leaving Anakin alive, as it was obviously “the will of the Force” that Obi-Wan be unable to finish him off, and “the will of the Force” that Anakin live on to kill Sidious himself in the future.
He explained to Luke, “I took it upon myself to train him as a Jedi. I thought I could instruct him just as well as Yoda. I was wrong.” His guilt was apparent in Revenge of the Sith, when he explicitly told Anakin in the heat of their duel on Mustafar, “I have failed you, Anakin.