Just like UK and US, Indonesia and Malaysia have common in their language. Both are rooted from Malay, but there are some differences if you hear accent of those languages. For example, "Saya" (it means "I or Me" in english) pronunciation :
Indonesian pronunciation: Say[a] - saya
Malaysian pronunciation: say[ə] - saye (with lilting voice)
The short History:
The term of "Malay" is derived from the Malay kingdom that ever existed in the area of Batang Hari River. During its development, the Malay kingdom finally succumbed and became subordinate to Srivijaya kingdom. Use of the Malay term extends to outside of Sumatra, following the territorial empire of Srivijaya which grew to Java, Borneo and Malay Peninsula. When Srivijaya fell, Parameswara (descent of Srivijaya King) flee to Malacca after flee from Tumasik (Singapore today) after being attacked by Majapahit empire from Java and create new Sultanate of Malacca. So, Malay People in Peninsula Malay were descendant of Sumatran people.