what are 词 whose whole word meaning is different from meaning of its components called? I'm thinking of 词 such as


  
  天真 = naive, but 天 = sky, 真 = real
  马上 = immediately, but 马 = horse, 上=up
  


also, if you could please provide any resource or insight on why these 词 are the way that they are. There's also 成语, which functions similarly, but that's probably going to lead to another question.
They are compound words  

Most characters have multiple meanings, in many cases an individual character in a compound word can also be a short form for another word 

Example:

"天真" is combination of two adjectives


天 means 天然 (natural) 
真 is short for 純真 (pure/ innocent)
"天真" = natural + innocent = naive


As for "馬上", it is a combination of a noun and a  preposition

"馬上" literally means "on the horse" . To get to the meaning of immediately, you have to use some extension of logic. When a rider mounted his horse, the departure is immediate, therefore,  "馬上" is used for the meaning of immediately.

There are many ways compound words are coined, you just have to memorize every individual compound word, like you would memorize every individual English word