Hanging 'lemon chili' outside the house and shop may seem like a strange practice, but there is actually a scientific explanation for it. Lemon chilies are a type of fruit that are often used in recipes, and they are known to attract pests. By hanging lemon chilies outside the house, you are likely to reduce the number of pests that come into contact with your food. In addition, the lemony aroma of the chilies may also deter pests from coming near your food.
In ancient times, when there were no proper roads and people traversed through jungles on foot to reach their destinations, they would carry a lemon and few chillies with them besides water. If they grew thirsty and dehydrated, they would squeeze juice from the lemon, which contains Vitamin C, into the water and drink it to refresh themselves.
As for the chillies, they played a big part in determining poisonous snake bites! While walking through jungles infested by snakes, people often got bitten. To determine whether the bite was poisonous or not, the victim would eat a chilli.
If the bite was poisonous, the victim's tongue would have no sensation as his nerves would be numbed and he wouldn't find the chilli bitterly pungent. But, if the bite was non-poisonous, he would immediately feel his mouth 'burn' due to the hot taste of the chilli.
Thus, the lemon and chillies served as a mobile first aid kit during those days.
Over time, it somehow led to the misconception that the lemon and chillies ward off evil while travelling.
For instance, folks in India throw it on the road in the hope that someone crushes it and all the bad omen / curses / evil that the lemon chilli absorbed / warded off would pass on to the person who crushed it.