Great question! Actually, it's not so much that people from different "races" look different, but that people who look different were categorized into races. I think it's really important for people to understand the historical and social context of the idea of race in order to fully make sense of how it impacts our lives today. Because I am most familiar with racial categories in the United States, I will use this as my central frame of reference.
Race, as it is thought of in the Western world, describes categories of physical attributes like color of eyes, skin, and hair. In some parts of the world, race is quite different. Historically, Japan has been quite ethnically and phenotypically (the way people look) homogenous, so there wasn't really much of a concept of race until Europeans and Mainland Asians began to visit. In Brazil, racial categories are far more flexible and may take into account factors like socioeconomic status and who you hang out with-- not just appearance! Comparing understandings of race from around the world should tip us off to the fact that race is a cultural phenomenon rather than a physical one.
The truth is that there is no biological reality of race. There is no one gene, or even a collection of genes, which determine that a person is White or Black or Asian. Even trying to lump people into these categories leaves a lot out of the picture. Within one "racial category" and even within one nation or city, there's a lot of variation in how people look. Let's imagine you have a bag full of jellybeans of every possible flavor and color, and I asked you to sort them into distinct categories. You could try to sort them into categories like blue, red, green, and so on-- but what about the purple jellybeans, the light blue, or the red with orange spots? You'd probably do your best to sort these with the jellybeans they look most similar to, right? Our understanding of race is the same way-- we try to sort people into groups based on how they look in comparison with stereotypes of race.
Though race is not a biological reality in the sense that there is one gene or one phenotype for how people of a certain race look, our stereotypes of race are based on actual physical characteristics. Color of skin, hair, and eyes, facial bone structure, and the texture of hair all may play a part in how we intentionally or unintentionally categorize someone. That physical categorization on its own isn't necessarily a bad thing-- humans love to categorize things, even each other! When we treat these categorizations as being fixed realities, creating a sense of "either-or," it can cause a lot of conflict about physical appearance. Even worse, historically and to this day, many people assign value to certain characteristics or associate a physical appearance with social behavior.
This is why race is a damaging social construct. The idea of race and racial categories takes the full spectrum of human appearance, our mixed bag of jellybeans, and tries to push them into a handful of boxes that leave out a lot of information. Prior to European colonialism, the idea of race wasn't very fixed. In fact, prior to and during the 16th century, most people used the term "race" to refer to people of differing nationalities. With increasing exploration and colonization of the world, race came to refer to the many different ways people looked in addition to nationality. With the international slave trade, the idea that people from a particular place look a certain way transformed into a very rigid hierarchy of phenotype as justification for human cruelty.
In the 17th and 18th centuries, explorers and scientists tried to devise a system of neat categories of race. The most popular and persistent of these systems was that devised by John Friedman Blumenbach, who argued that there was a biologically real hierarchy of humans categorized as Caucasian, Mongoloid, Malay, Negroid, and (Indigenous) American. This hierarchy was primarily based on skin color, with the lightest (European) skin being favored, and the darkest (African) skin being considered lowest. Though it was outwardly based on appearance, this hierarchy took on all sorts of connotations of physical and mental capabilities. Much of the racial oppression and human injustice caused by the international slave trade was "justified" because light-skinned Europeans genuinely believed that people of darker skin tones were not as smart and possibly couldn't even feel pain. Some people went as far as believing that it was their duty as a light-skinned person to rule over, exploit, and "shepherd" darker-skinned people.
As for why people from different parts of the world have different appearances, it's all about adaptation! Our species, Homo sapiens, first arose in Southeast Africa around 200,000 years ago. Since then, our ancestors have been busy spreading out around the globe. Though this journey was most likely motivated by a search for food, people eventually settled in every possible habitable environment. With exposure to these many variable environments, the general appearance of a population began to shift in response to environmental pressure. Our first Homo sapiens ancestors were likely dark-skinned, but those who migrated out of the high-sun environment of Sub-Saharan Africa did not require as much melanin to be present in the skin. Skeletal features like nose shape, height, or jaw shape may be a response to the air quality and diet of a particular region.
Today, we know that the social connotations of race aren't true. Especially as genetic evidence expands, we know that there is no real, fixed, biological basis for racial identities. However, beliefs about race are so deeply ingrained in society that it takes active and critical thinking to undo the things we have been taught (implicitly and explicitly) about race.