There's bacteria in everything. That's why you pitch yeast into the juice so it overwhelms the other bacteria already in the juice. If you let it ferment naturally, there's lots of yeast that live specifically on apples that will overtake any other nasties.
That said, good sanitation practices are essential. If you use storebought juice, it's already been pasteurized and doesn't need any more done with it if you ferment it in the original container.