A wing fence is designed to stop spanwise flow (out towards the wingtip) on the upper wing surface. By reducing the strength of this flow the strength of the wingtip vortex is reduced.
A320 style winglets are like endplates and presumably do the same thing.
Winglets like a 747-400 ..... don't know much about those so I'll keep quiet.
Hope this helps .. and don't panic!
Cheers, TP