Sometimes need to tap sump pump for it to turn on. Common causes?
There are 2 things I have found with floats controlling pumps of all sizes.

The first is corrosion and dirt buildup limiting float travel so the foot sticks and the contacts are open until tapped.

The 2nd is burned contacts. I have found with frequent cycling the contacts get pitted and may not close. On larger pumps the contacts usually can be cleaned but on the smaller pumps they are not serviceable. A tap on the pump many times will get the pump running for a while but once the contacts start failing a new switch will be needed.

Some pumps have provisions where the float has a cord and the pump has a cord. In this case a new float is can be installed.