Both Czechs and Slovaks are Slavic people and speak very similar languages, but apart from that, I don't understand why they joined together into Czechoslovakia instead of being 2 separate countries. Is there a historical reason for this?
Before becoming part of the Habsburg Monarchy, Slovaks and Czechs last shared a common state in 9th century under the banner of Great Moravia. After the Great Moravian Empire collapsed at the turn of the 10th century, Slovakia came under the control of Hungary and both nations went more or less their on way. So it might seem a bit strange that these different nations (albeit sharing a lot of common traits) decided to form a country together.
The reason for it lies in their history in the Habsburg Monarchy. Czechs were parth of the kingdom of Austria, while Slovaks were part of the Kingdom of Hungary. Both nations felt they were being opressed by their rulers and taken advantage of. Both regions were the most indutrialized ones of their respective kingdoms and Slovakia was very rich in natural resources. After the national revival in the 19th century, the intelectual and political elites of both nations realized that they had a much better chances of fighting back against the Habsburg rule if they worked together. The idea of the common state and czech-slovak brotherhood therefore emerged sometimes in the late 19th century. After the collapse of Austria-Hungary, politicians of both Czechia a Slovakia finally decided to form a federation since they believed that they would have a much better chance to have their voice heard in Europe than if they each formed their own little states.
Primary source: Igor Lukes, "Strangers in One House: Czechs and Slovaks (1918–1992)," Canadian Review Of Studies In Nationalism 2000 27(1-2): 33–43