The interior of Earth is very hot (the temperature of the core reaches more than 5,000 degrees Celsius) for two main reasons:
- The heat from when the planet formed,
- The heat from the decay of radioactive elements.
The Earth was formed by the process of accretion. After the creation of our solar system, meteorites gravitationally attracted each other and formed bigger objects, which attracted bigger masses, until our planets reach their current size. This process accumulated a lot of heat; when two objects collide, heat is generated. That is why your hands will get hot when you clap them for too long, or a nail gets very hot when you hammer it for a long time. This heat has not dissipated totally and represents about 10% of the total heat inside the Earth.
The main source of heat is the decay of radioactive elements. Radioactive decay is a natural process; unstable elements like 238U (Uranium) or 40K (Potassium) stabilise with time and produce what we call daughter products: 206P (Lead) for Uranium and 40Ar (Argon) for Potassium. This process produces heat, which represents about 90% of the total heat inside the Earth.