As I understand it, it's due to advances in the technology that supports biology and paleontology. When all scientists had to go on were fossils, the bone structure of dinosaurs more closely resembled giant lizards, so thats the conclusion they came to. But recent techniques, including genetic analysis on currently existing species, clearly shows the link between birds and dinosaurs. (And, in fact, alligators are more closely related to birds than they are to lizards.)
I found this article which seems to explain it well:
Or if your interested in paleontology discoverys/theorys they also do monthy reviews about new papers that have came out! And i feel like raptor chatter explains it simple enough to me to understand even with no background in the field 😅