Hi Anneza,
Probably it happened both ways:
Gary and
Garrett being forms of both Gerard/Gerhard and
Gareth.
The most common way to explain the origin of the names
Gary and
Garrett is via Frisian forms of
Gerhard: East- and West Frisian forms of
Gerhard are
Gerrit, Gerriet, Garrit, Gerret etc. which easily turn into
Gary /
Garrett in English.
... hope that helps? ;)
Satu