Why we see a spark when we connect a plug into an already switched "ON" socket?
It depends on your device, and the probability of hitting the mains AC cycle at its peak.

For a wall-wart (DC charger) for example, it has an internal capacitance that gets charged up by the line. If you plug in at the peak of the cycle, the inrush current will be large, resulting in the spark that you see sometimes. If you happen to plug in at mid cycle then there won’t be so much spark.

For this reason, good power supplies will include inrush limiters such as thermistors that limit line current during initial power-on.