Why are insects unafraid when you tap at them from the other side of glass?
Since insect brains do not contain enough neurons for higher level emotions such as fear, much of their behavior is programmed and reflexive. When you approach them, they have evolved to fly away. Glass, on the other hand is not something they evolved to "understand". They likely are not programmed to see something approaching them from below their legs as they are sitting securely on a hard substrate as a threat. They can look down. They just don't "get" glass.