Before I explain the reason to you, please allow me to show you some fun facts.
China the word was originated from Qin dynasty. Cin → Cine → Cina → China
Qin dynasty was the first Chinese dynasty which left deep influence to ancient Indians.
But in Russian language, China is called Kitay. Why’s that? Because of 契丹 Khitay, a northern nation in China in 11th century which had conflicts with Slavic nations.
Chinatown is called 唐人街 “street of Tang people”, because in 18th century, Chinatowns in different countries were established by Cantonese immigrants. Canton was not Chinese territory until Tang dynasty. So Cantonese call themselves 唐人 Tang people.
But in northern China in which people speak Mandarin, they worship Han dynasty because 汉武帝 (emperor Wu of Han dynasty, Liu Che) was the first emperor who chased Huns away and protected his people for ages successfully. So they call themselves 汉人 Han people. And because of northerners’ domination over China, Han became our nation’s call sign.
But why northern Chinese is called Mandarin? Because of a Latin word mandare, it means officials. Northern Chinese was the official language when Europeans started to do business with China, so official Chinese was called Mandarin.