A: When it’s a shock, even though it has a spring installed over it (aka “coil-over”)
If you’re unsure, a strut is used as a suspension locating device in place of the upper control arm; it is load bearing for lateral forces just like a control arm. A strut weighs more than double what a shock weighs, exclusive of the weight of the spring, as it must sustain large lateral forces, whereas a shock experiences zero lateral force, only force along its axis.
Not to be confused with a simple coil spring over shock. Struts weigh two to three times as much as a shock. A good comparison is the Honda Civic, sixth gen (shocks and upper control arms) vs. seventh gen (McPherson strut). See photos attached…
What are the performance advantages of a strut? Cost to manufacture is about the only one…
From a motorsport perspective, we can do cool stuff with struts but bottom line is a McPherson strut was born of the need to make something of acceptable quality whilst lowering cost to manufacture.
In other words, you’ll never see a strut on a purpose built race car constructed with a reasonable budget that’s not rules limited in suspension design.

Strut suspension, locates the suspension, loaded laterally.

Coil over SHOCK, does not locate the suspension, not stressed horizontally, only in the direction of an imaginary line drawn between the upper and lower mounts.