Some dinosaurs had feathers although they could not fly birds have feathers that help them to fly. In the context of evolution, we can infer that:
Birds have evolved from reptiles.
Reptiles are ancestors of birds, feathers were developed to form an insulating coat on the body so as to prevent the loss of body heat. But later, these feathers became useful in flight. This supported the view that birds are very closely related to the reptiles.