Bats and birds are not closely related. Both are vertebrates and amniotes, but beyond that, they are quite distinct.
Birds are in the class Aves, characterized by feathers, beaks, and wings. Bats are in the order Chiroptera within the class Mammalia and are the only mammals capable of powered flight.
Bats and birds share a distant common ancestor called the Synapsid, which existed around 300 million years ago. From this ancestor, two branches diverged: synapsids, which evolved into mammals, and sauropsids, which gave rise to reptiles and birds.
Over millions of years, bats and birds have evolved significant differences in anatomy, physiology, and behavior.