Thunder and lightning are different types of energies. Thunder is an energy of sound, creating audible waves caused by vibrations in the the air that you hear before and during a thunderstorm. Lightning is the electrical energy, or the flow of power that is visible in a thunderstorm.
We already know that thunder is the sound that you hear in a thunderstorm. This sound is caused by the rapidly expanding gases, along the channel of a lightning discharge. More than three-quarters of lightning's electrical discharge is used in heating the gases in the atmosphere in and immediately around the channel is that is visible. When temperatures rise over 10,000 degrees C, there is a violent pressure wave that is made of compression and rarefaction, which causes the rumbling sound of thunder.
We also already know that lighting is the electrical energy that you see in a thunderstorm. It is the visible discharge of electricity developed due to the build up of the electrical potential. This includes the build up between a cloud and the ground, between clouds themselves, within a single cloud, or between a cloud and it's surrounding air.
While both thunder and lightning can be dangerous and potentially fatal to some, again, both play different roles in a thunderstorm. Thunder is the aspect that brings the heavy rain, flash flooding, tornadoes, strong winds, hail, and of course lightning. Without thunder, there is no lightning. While the thunder can cause damage and sometimes even death, it is the electrical shock of lightning that people fear more because it can cause telephone lines and other electrical outlets to spark and ignite fires on trees and bushes.