Why is it called a shoo-fly pie

The name “shoo-fly pie” evokes a playful image of swatting away pesky insects drawn to its sweet aroma. Originating from Pennsylvania Dutch country, this molasses-filled dessert was a favorite among farmers, who often had to “shoo” flies away during mealtime.