A yellow spark is shown on the monster/player that you've attacked when the armor absorbs the damage done from a hit. Hits that cause a spark do not count towards your shielding skill.
When a monster is immune to certain damage types (physical or magical), it also produces sparks.
Sparks show also during skinning with Obsidian Knife. Green spark means successful skinning and yellow one on unsuccessful try.
Green spark show when player got banned, or if someone heal using Heal Friend
in the past when a player used a furniture kit outside of their house, it produced sparks. The sparks appeared where the kit was, so when it was in a backpack, the sparks appeared on the player's character as if it's being hit.
Since update 10.92 you can no longer "use" furniture kits.