Mistaking it for its prey
A large number of shark attacks happen as the shark mistakes a human for its natural prey. Shiny jewelry for example can seem like fish scales from a distance.
The shark adapted to human taste
Sharks naturally don’t like eating humans but if it happened by mistake that sharks ate a human then they could adapt and develop a taste for humans. If, for example, a body was dumped in the water as a result of criminal activity then the shark might eat it then change its taste.
Touching the shark
Many sharks attack humans when they are provoked through touching. Provoked shark attacks are very common. This can also happen if the shark was disturbed in any way.
Thinking that a human is a threat
Sometimes a shark can attack a human out of fear. If for some reason that shark believed that a human is a threat then it might attack him.
Mistaking him for a seal
When a surfer wears grey and lies on his surf board he usually seems like a grey seal to the shark swimming underneath. The shark can then attack the human, thinking that he is a seal.
When a shark fails to identify a swimming object it usually makes an investigatory bite to see if this object can be good food. Many of the shark attacks involve a shark biting a person then leaving.
Thinking that he is a competitor
If a shark saw a human around when there were other fish it might think that this human is competing with it for its food and as a result it might attack him. (See How to Evade a Shark Attack?)
To defend its space
Some sharks attack other humans just to defend their own space. In such a case, the shark might try to attack other sharks or humans just because they are invading its territory.
Since sharks are at the top of the food chain they are usually very curious as they have nothing to fear. A shark could attack a human by mistake while exploring.
Sharks were fed different food
If sharks were continuously fed a different type of food then their tastes might change and they might develop an appetite for the low fat human flesh which they usually don’t like.
Blood and noise attracted them
Both the smell of blood and the noise humans make by splashing water can attract a shark. Sharks are very sensitive to those sounds, in addition to the smell of blood. The presence of those two things, or even one of them, can lead to a shark attack. (See What should you do if you are attacked by a pack of wolves?)
What to do if a wolf approaches you? How to survive a wolf encounter? How do you scare off a wolf?