Fission and Fusion don’t always release energy- they both only release energy under certain conditions (well, one condition really). For example, if you split a helium atom into two hydrogen atoms, you don’t get any energy (in fact, it takes energy to do this). Likewise, if you smashed two cobalt atoms together to make a xeon, you don’t release energy (similarly, this would take a bunch of energy to do).

Fusion will release energy until the atoms you’re fusing become iron (interestingly enough, stars which supernova do so because their core fuses to iron, Fusion stops immediately, and the Fusion pressure holding the shape of the star stops, so all of the other material in the star not in the core collapses to the core, rebounding off the core, and then exploding out into the universe). Fission will release energy until the atoms you’re breaking apart become iron. Iron is close to the most stable (in fact, by some measures it is the most stable, but traditionally we say Nickle is the most stable), but there are no known Fusion or Fission paths to get beyond iron, so both directions end there.

So, what determines if there is energy release in a Fusion or Fission reaction? The binding energy and mass defect. The mass of an atom is less than the mass of its individual components. For instance, the mass of Helium-4 is 4.8e-28 grams less than the mass of 2 protons and 2 neutrons. Which, isn’t much, but using the mass-energy equivalence it tells you the amount of energy stored in the binding of the nucleus.

So, as you go up from Hydrogen towards Iron, the binding energy per nucleon goes up- which means the mass defect also goes up, so that energy is released via Nuclear Fusion. But if you have heavy atoms, as you get smaller then there is more binding energy per nucleon, so if you split the atom apart you release energy.