Static electricity is electricity
at rest as the name suggests.
It accumulates on insulators* such as plastics and remains there until it is discharged.
Ions floating in the air can
freely move.
You are more likely to get an electric shock when the air is dry because your body is more likely
to be charged when humidity is low.
This phenomenon is less likely to occur under high humidity because electricity flows away through water droplets in the air.
*Materials which do not allow electric current to flow