A long time ago,a carter was driving his cart,when a mantis jumped out in front of the cart. Raising its forelegs,it tried to block the way of the cart. The carter thought how ridiculous this inscet was,then moved on forwards. Easy to imagine,the fool but rather bold mantis was crushed by the rolling wheels.
Nowadays,this idiom is used to mean overrating the ability of oneself and trying to do what is beyond one's power. The result can be nothing but failure.