piston slap is caused by having excess clearance in the bores, either by having worn bores, or collapsed piston skirts, or having forged pistons which require a lot more piston to bore clearance, due to the expansion rates. (Or you own a Subaru)
The skirt of the piston hits the side of the bore on the power stroke, as the piston is on the way down after ignition.