Many things are sorted into groups to make our lives easier. Similar foods are grouped together in a supermarket and books are put in shelves according to types and categories. This is called classification and scientists sort organisms into groups depending on what they look like and how they function. The influence of the environment is not taken into account when classifying organisms, but only the genetic differences of organisms.
The first attempt to classify organisms was made by an ancient Greek thinker, Aristotle, who lived in the 4th century BC. He divided animals into two groups, those with red blood and those without. Theophrastus, Aristotle's student, classified animals according to what they were used for. As more and more species were discovered, those groups became too big. An English scientist, John Ray (1627-1705), divided plants and animals into smaller groups; for example, he divided animals with four legs into those with hooves (e.g. horses) and those without (e.g. tigers).
Eventually, in 1735 Carl Linnaeus examined thousands of plants and animals and gave them all a two-word Latin name. For example, humans are called Homo Sapiens. This prevents confusion with common names of organisms; a badger in the UK is a totally different species to the badger found in America. After putting all known organisms to smaller groups, Linnaeus ended up with two large groups he called kingdoms.
Today, scientists classify organisms using five kingdoms: plants, animals, fungi, bacteria and protoctists. Each kingdom is divided into smaller groups.