More specifically, I was reading about the Batavia mutiny and saw a map of its location. There are several other shipwrecks there too. If they were all headed for Jakarta, what were they doing way down there, nowhere near Indonesia?
It was due to the wind patterns, here's a picture on wikipedia that should give you an idea. East Indiamen going to Indonesia would head down the Atlantic (which would take about three months or so), round South Africa, and then pretty much due east until they were almost at Australia (which only took a couple of weeks) at which point they would turn north for indonesia. The first few voyages went up the coast of Africa and via India, but they quite quickly pioneered the new southern route, which cut several months off the voyage. As you can see from all the wrecks though, it was pretty dangerous, as they had very little idea of where the coast of Australia was (or what was there at all) and the methods for finding longitude were very unreliable at the time, so they could have been a long way east or west of where they thought they were.