In general, European countries were able to acquire colonies because they got the necessary technology before anyone else did. By the late 15th and early 16th century, the European countries were far ahead of any other region of the world in terms of technology. They had ships that could carry relatively large crews and cargos across long distances. They had steel weapons and armor. They even had guns that improved in quality rapidly as time went by. None of the other people of the world had all of these things. Because of their advantage in technology, which largely means having better weaponry, the Europeans were able to conquer other countries and colonize them.
The more interesting question is why the Europeans had better technology than anyone else. This is a much more controversial question. Over the years, people (mainly of European descent) have tended to argue that this is because Europeans are racially superior to other peoples. This argument has fallen out of favor and has often been replaced by one that says that Europe’s culture was more likely to allow technology to be created and used. They say that European culture was more willing to accept change and was more forward-looking than other cultures. My own view is that Jared Diamond is correct in his book Guns, Germs, and Steel. Diamond argues that the Europeans were able to get better technology because they had better geographic luck. That is, they lived in an area that was able to get agriculture before other people got it. This meant that they could build large, sedentary societies, which are conducive to creating technology.
The immediate cause of the Europeans’ success, then, was their superior technology. There are different views as to why they had this technology, but I subscribe to the idea that geographic luck played the main role in causing this to happen.