What is the difference between the way a falafel is made and the way an onion baji is made? It seems both seem to be based on embedding some veggies in flour and frying it.
They're both fried, but they don't seem to be that similar in composition.
Falafel isn't veggies in flour, it's pretty much just a seasoned chickpea (or fava bean) paste. That paste is pretty thick, so while it might have some extra flour to bind even better, or to make it easier to form into balls, it's not just a flour-based fritter. And sure, the seasoning might include onion, but it won't be made of onions.
Onion baji, on the other hand, is primarily made of onions and flour as you say.