Consider 1g of iron, which has a specific heat of 0.45 J/g$^\circ $C. After heating it by 10 degrees, it stores an additional 4.5J of energy. You can compare this to other forms of potential energy, like compressing a spring, or raising a weight to some height, or charging a battery - you put in energy which gets stored in some way.
Contrast that with 1g of water, which has a specific heat of 4.2 J/g$^\circ $C - after heating by 10 degrees, it stores an additional 42J of energy. More energy is added than by raising the same mass of iron by the same number of degrees. This is analogous to compressing a stiffer spring, or raising a heavier weight, or charging a bigger battery - you put in more energy which gets stored in some way. For any particular mass and temperature, water holds more thermal energy than iron.
As a consequence of this, iron will heat up and cool off faster than water, since it takes less energy to go through the same temperature change. You could think of a cooling mass as a discharging battery, where stored heat energy is put back into the environment. A block of iron will cool relatively quickly, analogous to a battery that doesn't hold much charge, while the same mass of water will take much longer to cool, like a bigger battery that holds more charge.
In your added example of blocks A and B, we define the blocks to have the same mass but different heat capacities. Heat capacity is the amount of energy required to change the temperature of a unit mass of material. So, if you impart the same amount of energy to objects of different heat capacities, they will change in temperature by a different amount. 815
As shown above, if you apply 42J of energy to 1g of water, it will increase in temperature by 10 degrees. If you apply that same amount of energy to 1g of iron, it will increase in temperature by 93 degrees. We've defined the situation where we impart the same amount of energy to both, in this setup, we're not "leaving behind" any heat by definition.
But suppose we don't impart the same amount of energy to both, but we instead just leave both masses in an oven at a specific temperature. Now we're not imparting the same energy to both, but we are instead going through the same temperature change in both. Since a higher heat capacity requires more energy to change temperature, the water absorbs more heat energy than the iron when going through the same temperature change. The iron will heat up quickly and reach the temperature of the oven, at which point it will not absorb any more heat energy or change in temperature. The water will continue to absorb heat, slowly increasing in temperature until it reaches the same temperature as the oven. At this point, both the iron and water are at the same temperature, but have absorbed different quantities of heat.
For objects of different heat capacity, you can either impart the same amount of energy for different temperature changes (e.g. by leaving both on identical bunsen burners for 1 second), or go through the same temperature change by imparting different amounts of energy (e.g. by leaving both in the oven until equilibrium is reached). 797