They didn't. Both games are dependent on one or more forms of football that were codified in England, just like American Football.
Think of them as forks that have deviated little enough, or deviated in similar enough ways, from the upstream that they are still somewhat compatible.
Gaelic and Aussie rules aren't so much dependent on codified association football as they were each somewhat independent codifications of existing games.
Association football has only existed as a codified game since 1863 - football before then was just a spectrum of local games played across Europe with little in common as areas got further away. Around the time of the codification of association football it was noted that different people in Ireland were playing association football, rugby football, and a third distinct game people referred to as "Irish football".
Modern Gaelic football was codified in 1884, and its rules were "dependent" on English football forms in the sense that it's codifiers explicitly rejected anything that was regarded as an English influence in writing the rules. It was a very nationalist time in Ireland and the GAA is an Irish nationalist organisation - they tried to keep out elements that were perceived as foreign, and integrated a lot of elements of hurling (a very distinct Irish game played with sticks that predates written history in Ireland).
The similarities between Gaelic football and Aussie rules is probably not a coincidence, but it's not because of soccer - the Irish diaspora played Irish football in Australia, and how the game was developed there had an influence in how the game was codified into Gaelic by the GAA. Irish football may have had an outsized influence in how football was played in Australia that it didn't have in Britain.
American football does more directly descend from codified English rules of football - Harvard were big proponents of rugby-style rules, which evolved into modern American football.
Why does your post repeatedly mention soccer? I'm not talking about Association Football anywhere, it's irrelevant to this discussion. Aussie and Gaelic are based on or depend upon or took influence from Rugby Football, not soccer.
The idea that Gaelic and Aussie were developed independently on opposite ends of the earth, in English-speaking crown colonies, and randomly just so happen to be compatible enough to play against each other be is absolutely barmy and I can't believe anyone is espousing it.
Football was everywhere (e.g. calcio in Italy) The English codified rules for it but that doesn't mean Aussie rules or Gaelic Football are derivitives of the English game.
Medieval kicking games were everywhere, yes, in China and Florence and all kinds of places.
Unless you have some evidence to the contrary, I think it's quite clear they are directly descended. Factors include chronology, similarity of the games and both places being English colonies.
Proto Australian Rules Football predates European settlement of Australia and possibly even European settlement of England.
Marn Grook, marn-grook or marngrook is the popular collective name for traditional Indigenous Australian football games played at gatherings and celebrations by sometimes more than 100 players. From the Woiwurung language of the Kulin people, it means "ball" and "game".
And you're telling me you believe the white Australians adopted and codified this indigenous game instead of one based on English Rugby Football? It doesn't seem likely.
Like I said, medieval kicking games were everywhere, including marn grook, but I don't see any evidence that Aussie Rules is based on it. "Some historians claim" is the strongest sentence in that Wikipedia article.
I'm saying I believe that Australian settlers were heavily influenced by many things that indigenous people did; what to eat, where to find good water, how to manage land, but they rarely acknowledged that influence.
The original version of AFL played by English settlers was a great deal more like original Marn grook than 'modern' codified AFL - the playing area was larger and effectively unbounded (save by the need to score through designated goal areas, etc).
Indigenous influence on AFL creation confirmed by historical transcripts, historian says
Monash University historian Professor Jenny Hocking found transcripts placing Indigenous football, commonly known today as Marngrook, firmly in the Western district of Victoria where Australian rules founder Tom Wills grew up.
"We found in the State Library of Victoria records of a transcription of an interview with [Mukjarrawaint man] Johnny Connolly, who describes actually playing the game in the Grampians region as a child in the 1830s to 40s,"
You're entitled to your opinion but I'd hazard a guess you never grew up playing barefoot football on stony ground with aboriginal teams whereas I did (40 years ago).
Everybody seems to wear shoes now and many of the remote fields have grass now, with a few exceptions:
The Australian game is the first form of football to be codified. It probably does owe something to other forms of football around at the time in England, and perhaps also to a local indigenous game named marn-grook, but it was the first to have an actual codified set of laws. It's a winter game, designed to keep cricketers fit out of season, which is why it's played on an oval field (and the final is played on the Melbourne Cricket Ground).
This isn't just a feel-good story. Tom Wills, the main inventor of Australian football, was raised as the only white kid in his area, and played with the Indigenous kids.
I should have checked that after posting. It was supposed to be an asterisk indicating a footnote, and then another indicating the footnote itself. Normal markdown implementations don't span italics over paragraph breaks.
You also get Shinty/Hurling matches between Scottish and Irish teams.
If you don't know what Shinty is, imagine if you took Ice Hockey, got rid of all the ice, allowed people to swing from as high and back as they like (golf swing, rather than "keep your stick on the ice"), and just in general made Ice Hockey really fast and violent.