X chance to do Y damage - how/when does it work?

I have a question about two modifiers found on items - X chance to do Y damage and X chance to increase Y damage by Z.

Say an item gives me 10% chance to do 100 physical damage. When/what triggers this?

What if the item gives me 10% chance of 100% increased physical damage?

If it’s on the standard stats of an item, it happens when you attack, though you will find most of those on weapons apply to weapon attacks, but on armor, it usually says retaliation damage, which means that when you are hit, the damage is done to the attacker.

If it’s on a spell that exists on an item, it’ll tell you how it is applied in blue right above it. On hit/crit, are when you attack someone, and works on any attack. There are other categories, such as when you are hit, or when you have 45% health, or what ever it says.

If it says 10% chance of 100% phys damage, if it’s on a weapon, it just applies 100% physical damage to that attack (as if you had a stat that increase physical damage by 100%). Sometimes it’ll give you the bonus for a duration of time, but it tells you.