When you throw a ball over a fence, you throw it above the top of the fence. Generally we'd infer that someone was standing on the ground and threw the ball above the fence to the other side, though if you started out above the top of the fence (in a tree or on a ladder or something) and threw the ball above the top of the fence, that'd also be throwing it over the fence, technically.
To throw the ball through the fence means the ball traveled from one side of the fence to the other without going over or under it. So in most contexts that would leave three basic possibilities:
- There was a hole in the fence, and you threw the ball through that hole.
- The fence had sufficiently large gaps between its rails (or slats, beams, links, etc.) to allow you to throw something between those rails.
- You threw the ball so hard that you smashed a hole in the fence, and the ball continued on through the hole and out the other side.
In any general conversation, where the person you're speaking to doesn't know anything about the fence in question, if you told that person "I threw the ball through the fence," they wouldn't know which of those two you meant.