Bells wanted to know. And it's a good question.
For the most part, the difference has to do with materials and gauge. But really? The biggest indicator is starch.
Doilies are knit at small to super-insane-small gauge (remember the quad zero needles?), usually with very strong plant fibers like cotton and linen, and when they're blocked, they're most often starched to within an inch of their lives. They are almost always lace. For instance, I plan to knit my test doily on size twos (large for a doily, so I can see what's going on) with #10 crochet cotton, and starch the begeezers out of it when I block it.
Shalws are knit at all sorts of gauges with all sorts of fibers, and of course NOT blocked with starch. (Or at least, very rarely. I'm sure someone's done it once.) They are not always lace. I plan to knit my mother-in-law's Christmas shawl on size three or four needles (small for a shawl), with silk and beads, and NOT starch it when I block it.
Basically, it's an arbitrary designation, more about how the final product is used than anything else. You can use doily patterns to knit shawls, but you usually can't use shawl patterns to knit doilies - though some of the more elaborate circular ones would work. It kind of reminds me of tongue-in-cheek "Is it a shrub or a small tree?" discussions between botanists. (Yes, geek humor is strange.)