The Law of Similarity states that things which are alike are connected. If you wish to affect a person with magic, then a photograph of that person, a personlike doll, or an effigy of some other sort, is a significant tool. If you want to act on a field, a handful of dirt would help.
The Law of Contagion states that things which were once connected remain connected in some way. So, if you wish to work magic on a person, some of their hair would be of value. If you want to act on a field, a stone from that field would be helpful.
Holy communion is a form of ritual cannibalism, in which wine becomes blood through a magical act rooted in the law of sympathy. The shroud of Turin is holy because of the law of contagion. A classical 'voodoo doll' obeys both principles - a manikin containing bits of the target.
Set aside your ideas on the truth or untruth of magic for the moment, and consider this: Whether or not there's anything going on in magic, these laws represent basic human thinking. Take a quick look at the gestalt principles (Linky), for some fun optical effects. The gestalt principles show some weird tricks in how we frame visual input and turn it into recognizable stuff.
The law of similarity ties into object sorting; we sort objects in reference to each other by defining the things that they have in common. The law of contagion ties into basic activities of all sorts - these objects were part of that stack, that's John's blood and he's sick - stay back!
Some readers will likely look at this as and think "So, magic is a set of cognitive illusions created by rules of thinking, just as optical illusions can be created by rules of perception". And that's fine, but it's also a simplistic read.
Magical thinking (and I do include religious thinking here) is use of cognitive 'cheat codes'. It's possible, by refining and examining your faith, to change your own thinking in ways that are swift and intense. The sharing of magical thinking comes at the mind in a way that bypasses reason.
It's like magic.