In modern taxonomy, living organisms are classified based on their ancestry and evolutionary relationships with other organisms. Animals are organized into groups called clades, which must include a common ancestor and ALL of it's descendants. Smaller clades can exist within larger clades. For example, the clade Diptera (true flies) exists within the larger Insecta clade, which further resides within the larger Arthropoda.
However, not all clades properly match the ancestry of it's members. There are a couple of reasons for this. For one thing, taxonomy predates the theory of evolution. Because of this, organisms used to be classified based on their physical traits rather than their evolutionary relationships with other organisms. The second reason is that even today, we don't fully understand the genetic relationships between all organisms, and we often have to make educated guesses based on their physiology. These guesses aren't always right, and animals are often misclassified. Sometimes these errors are minor, such as a single species being place in an incorrect but closely related genus. But sometimes, huge clades will be placed in groups in which they don't belong, or excluded from ones in which they do.
One example of this involves birds and crocodilians. Crocodilians are traditionally considered to be reptiles, while birds are usually excluded from Reptilia. However, both crocodilians are more closely related to birds than to other reptiles. Indeed, both are members of the clade Archosauria. This either means that crocodilians (along with all other archosaurs, including the dinosaurs) aren't actually reptiles, or that birds are reptiles.