What is speaking in tongues?
'Speaking in tongues', or 'speaking in different kinds of languages', is one of the signs that Jesus Christ said (Mark 16:17) would accompany those who believe in Him.
The Bible (1 Corinthians 12:8-11) describes speaking in tongues as one of the spiritual gifts that those who follow Jesus and are filled by His Holy Spirit are empowered with (along with a sister gift, 'interpretation of tongues').
Other related terms or concepts are 'praying in the spirit' and 'praying in a heavenly language'. These ideas are all found in the Bible but are not necessarily practised by all Christian believers.
Tongues are utterances of prayer to God or messages that glorify God and they can either be in a known language (in other words, a language that someone, somewhere on earth would understand) or an unknown language - a heavenly language that no one understands.
But in either case, the person who is speaking in a tongue does not know that language themself. It may be a known language (like French, Spanish, Mandarin, Hebrew and so on) - but not to them! In other words, the person speaking in tongues does not know what they are saying in the moment that they are speaking it out.
There are many cases that we know where a believer has spoken a message in a tongue and had no idea what they were saying (or even that the tongue they were speaking was a 'known' language) only for a listener who heard the word to come forward and testify that they DO know the language and that they understood what God was saying through the person speaking in the tongue!
Why is language important?
Humans were created to be in perfect communion with our Creator God. In the beginning, all of mankind spoke in one language and were in direct contact with God. Adam and Eve walked with God 'in the Spirit' in the Garden of Eden.
However, as a consequence of man's disobedience, we soured this relationship and walked away from our Lord. By Genesis 11 we find that prideful humans have come together to build a tower at Babel that will 'make a name' for themselves - they want to exalt themselves higher than God. We see that prideful, sinful man will try to use every advantage (including the ability to communicate with one another without need of translation) to usurp God. At this point God confuses their language - they get different tongues - and they can no longer understand each other. From that point, people and people groups became scattered across the earth.
Now let's skip forward to the book of Acts...
In the Upper Room on the day of Pentecost, God pours His Holy Spirit out on His people who are gathered there. Most of those in the room probably only spoke Aramaic or Hebrew. When the Spirit filled them they began to speak in other languages and are heard and understood by the people outside in Jerusalem. The same nations who were formed after the scattering at Babel now hear and can understand the Good News for the first time! In that moment, language, which for so long had been something of a curse, was being redeemed for its intended purpose: to glorify God and draw ALL people from EVERY tribe and nation to Himself.
One day in the future an innumerable gathering from every nation, tribe, people and tongue will join together to praise God in one voice (Revelation 7:9-12) and worship God on the throne. Babel will be reversed and different tongues/languages will be no more - the spiritual gift of tongues will cease, no longer necessary.