Straight forward question, really.
Why is it that some magic wears off after the caster dies, whereas other forms of magic stick around long after the casters death?
In the Half-Blood Prince, we learn that Lily Potter had once transfigured a lily into a fish for Professor Slughorn, and that when Lily died, professor Slughorn found the bowl that held the fish to be empty (i.e. the effect of the magic wore off). Additionally, towards the end of Half-Blood Prince, Dumbledore casts a full body bind on Harry, that is lifted after Snape kills Dumbledore.
However, in other places throughout the series, we see that the death of a witch/wizard does not necessarily result in the effects of the magic they have cast disappearing. For instance, the permanent sticking charms that Sirius placed on the decor in his bedroom in the House of Black (or for that matter, the ones that Sirus's mother places around the house) or the curses that Moody places on the entrance way to the House of Black to prevent Snape from entering/speaking of the house (tongue binding curse, and the dust corpse of Dumbledore). I also think Mr. Weasely references a biting teapot set that passed from a witch to a muggle in Chamber of Secrets.
So what is it that causes some magic to wear off after death? Is it the type of magic (i.e. transfiguration requires a higher concentration of magic, therefore is less likely to continue after the caster's death)?
Speculation is welcome, but cannon support will be helpful.
Please note, I did find this question which addresses what would have happened to Hermione's enchantment on her parents' memory had she died, but it did not fully explain why some magic outlives its caster (in my opinion).
Additionally, as pointed out by Phantom42 in the comments, there is this answer which addresses that some magic lives on past the time the wizard who casts it passes, while other magic does not (giving examples of where we see each in the books), and this question which asks if a spell is forever, but gets the same response that some spells are, while others are not.
What I want to know is WHY some magic lasts pasts its caster's death, while other magic does not.