The thermal energy is generated due to heat in any object or due to the heat in the surrounding medium. If you look into the generation of heat, you would realise that it is due to the vibration of the atoms and molecules in any medium or substance. The greater the speed of vibration, the more would be the heat which is generated as well.
If you look into the example of a matchstick, you would realise that when you rub the matchstick against a particular surface which is uneven, there is generation of fire and this generation of fire is due to the generation of heat which is due to the vibration of the molecules of the substance with which the matchstick is coated.
Due to the nature of the thermal energy, that is because they are caused due to the vibration of the molecules and atoms, the energy is kinetic form of energy.
Thermal energy is often found inside the earth as well in the form of heat. During the summers, the heat of the Earth is on the lower side where as during the winters, the heat of the earth is on the higher side. This heat which is present inside the earth can be converted into electricity or it can be used to regulate the temperature of your house as well.
This is the working principle of geothermal electricity as well.
The thermal energy has a wide range of applications ranging from electricity all the way to controlling the temperature naturally. When you are using geothermal energy for the controlling of the temperature, you would be just passing the water through the pipes and then through the structure and the temperature of the structure would be automatically regulated.
When the heat is generated due to the vibration of a particular set of atoms and molecules and is dispersed over a larger range of items and molecules, the thermal energy or the heat energy which is contained in those atoms and molecules get automatically reduced.
Each and every substance or medium has a different capability to generate the amount of heat and thereby the thermal energy. Some materials are good conductors of heat due to the vibration of molecules wheras some of the materials are not able to vibrate that easily and therefore they are not good conductors of heat.So, thermal energy is the energy which is generated from the heat due to the vibration of atoms and molecules of any substance.