Very interesting question!
Usually I do my research and then know very specifically what I want, which color, etc. (Helmets for instance) I feel like when I go to the bike shop for those items, they would always try to steer me in the direction of something they have in stock. So I usually just order online. I find it very uncomfortable to deal with a shop when they don't have that item I want.
Sometimes they are nice and offer to order it specifically for me though. I figure if they offer, it will make them money.
I do give local bike shops business when it comes to things where I dont care about the color etc. If I am in there for maintenance, I will pick up some spare tubes, lube, bottle cages, etc. I dont really care if I save 50 cents on a spare tube by ordering online.
Interestingly, a local bike shop owner told me recently that selling new bikes is actually a low profit margin business. He makes most of his money on repairs and accessories. Go figure.