Two hydrogen nuclei are both positively charged, so they repel, and the push grows rapidly as they get closer. Only when they are about 10−15 m apart does the strong nuclear force, which acts over that tiny distance and no farther, take hold and bind them. Getting that close takes enormous speed, which means enormous temperature: about 15 million kelvin in the Sun's core, where crushing density and a quantum effect called tunnelling help, and over 100 million kelvin in reactors on Earth, which cannot copy the Sun's density.
The payoff shows up on a scale. Deuterium (one proton, one neutron) plus tritium (one proton, two neutrons) gives helium-4 plus a neutron. The products are 0.0189 u lighter than the starting nuclei, and that mass becomes 17.6 MeV of energy. Shared among the 5 particles that went in, that is about 3.5 MeV each, four times what uranium fission gives per particle (about 0.85 MeV).
Fission releases energy by splitting heavy nuclei, so it looks like the exact opposite, and in direction it is. Both work for the same reason: the products are more tightly bound than what went in. Binding is tightest near iron, so joining light nuclei and splitting heavy ones both move toward iron and release energy. Fusing nuclei beyond iron would move away from it and absorb energy, which is why a massive star's core stops producing energy once it has turned to iron. To tell fusion from fission, look at the inputs: light nuclei joining, or a heavy nucleus breaking.
Think of it like this. Fusing two nuclei is like pushing a ball up a steep hill that has a deep crater at the top: push too gently and the ball rolls back, because electric repulsion wins; push hard enough to reach the rim and it drops in, releasing far more energy than the push cost. Real nuclei can also tunnel through the top of the hill, which a ball never does.
Core idea. Light nuclei release energy when they join because the product is more tightly bound and slightly lighter than the parts; the lost mass appears as energy, E=Δmc2. The catch is the electric repulsion between nuclei, which only extreme temperature and pressure can overcome.