The terms are old and usage refers back to old techniques. Roasting was generally a live fire cooking technique, spitted and turning in front of the fire or over coals.
Baking was generally an enclosed technique, buried in the ashes, in a dutch oven, or inside a brick oven.
With the rise of equipment and infrastructure, you could use the one tool for multiple "techniques" though you used it the same way without regard to the technique you did.
In modern parlance, I think the difference between roasting and baking breaks down along the use of grains. breads, pies, cakes are baked because you are cooking grain products-- all things that were traditionally cooked with enclosed heat. Where you run into some possible confusion is with things like baked frried chicken. You're using a baking technique to set the crust on the meat instead of frying, so it's still about the grain.
For much of history, individuals didn't have their own ovens but used a common oven in the town square where the town gathered to bake their bread all together all at once (Greece). It didn't make sense for each to have their own oven for baking. Or they patronized the business that had the oven. This is only recently changing even now in countries like India and China. Most home "baked" goods were steamed in China. The bakery was a specialty business.
It's from these old ovens and dutch ovens where all the falling oven techniques developed. Popovers, dutch babies and so on. These are put in a HOT oven and the temp reduced over time.
This replicates how the old ovens would be fired up, but cool over the baking time as fuel was not replenished.
An example of low tech roasting http://www.williamrubel.com/a-string-roasted-turkey/
And a discussion of fired bread ovens http://www.williamrubel.com/bread-oven-basics/
Scroll down, he has a big image that occupies most of the screen.