A shark’s sense of smell is pretty good but it gets a bit exaggerated sometimes. It’s not so incredible that sharks can smell blood from “miles away”, but it is pretty good. Sharks can follow scent trails the same way bloodhounds follow scent trails on land, so a shark can come from miles away if the blood trail in the water happens to be a couple of miles long (which can easily happen).
Sharks are VERY attracted to fish blood. They aren’t so much attracted to human blood, but they will react to it. Mythbusters did a demonstration of this on one of their episodes. You can see the difference in this video clip:
Sharks are also attracted to other strong smells. It’s not just blood. There’s a common legend that urine will mask the smell of blood and save you from shark attacks. What actually happens is that the shark will smell the strong smell of urine and will usually come over to investigate, so peeing on yourself to mask the blood actually tends to attack sharks not repel them.