How is it that (temperature) heat makes some seasonings and foods (spicy) hotter, but mellows others? Toasting many spices,and heating some peppers increases and brings out the spice and heat. Other foods, such as onions, shallots and garlic (yes, I know they're from the same family; just can't think of other examples right offhand), it mellows their bite.

Is there something scientific to this? It doesn't seem to be component specific, as capsaicin is the main heat element in peppers, but some, such as jalapenos, actually seem to mellow a bit with roasting. 
Unless the ones I've roasted were just randomly mellower like jalapenos from even the same plant can vary anyway? 

I understand the pepper itself doesn't actually get hotter; cooking just releases some of the capsaicin oils. But why would it affect other foods the opposite way, and how would peppers even vary in how they respond to cooking heat?
I expect that you have already considered the most probable answer. For some spices, the aromatic compounds are released by some heat, but are not destroyed. Thus their effect is heightened. For other compounds, even a small amount of heat will destroy them and thus reduce their effect - see Mischa's comment.

I believe that the difference essentially lies in at what temperature a flavoursome compound starts to degrade.