The function of the winglet is to reduce drag created as a consequence of the creation of lift.
They limit the formation of wingtip vortices and thus the amount of drag created.
Borrowed from the Boeing website, this picture shows how effective they are at reducing the wingtip vortices!