I've seen many people leafing through the books and then leaving them in the cafe to go to ruin. The problem with tech books is that some of them have a short life span, so I can see why someone would want to go through it and choose to purchase it cheaper online.
I used to purchase them in the store with my employee discount. Sometimes what I would buy would be a book that has a little wear due to people looking through it. I've gotten the same result from supposedly "new" books from Amazon.
The fact that the store even lets employees get discounts on it suggests that the markup is too high. The brick and mortar stores need to come down a little bit on the price if they want to compete, at least give a discount equal to the amount of sales tax.