First of all, airplanes ARE affected by lightning:
https://abcnews.go.com/Travel/story?id=3994564&page=1
However, as others have pointed out, the metal skin of the plane acts as a Faraday cage – the lightning bolt travels along outer surface, leaving people and things inside the plane (mostly) unharmed.
Pilots are VERY careful about avoiding thunderstorms. Not only is there a risk of lightning but a thundercloud can contain hail and strong up/down-drafts, both of which are dangerous in themselves. Best case is that passengers will be extremely uncomfortable, worst case is [severe damage to the aircraft](https://www.washingtonpost.com/news/capital-weather-gang/wp/2018/06/05/scariest-flight-of-my-life-hail-smashes-nose-of-plane-that-flew-into-towering-storm/) with a risk of total loss of the aircraft and everyone on board.
Latest Answers