I'd like to take a different approach to answering this question: Numbers!
Both races have the same limits on their strength, and athletics, but it's hard to imagine why.
Presumably, this is to allow the role play opportunity of playing a Gnomish fighter who is excellent with a sword. Key stats are key stats, and cherry picking limits actively disincentivises creative character generation. No, it's probably not realistic.
A Goliath could feasibly lift and throw a gnome,
Let's prove it.
Average characters have average stats: 10 across the board. Goliaths get a racial +2 to strength, giving an average Goliath a strength of 12. They also all have the racial trait Powerful Build, making them count as Large for the purposes of moving stuff.
The section Lifting and Carrying on PHB 176 says the carrying capacity of a str 12 character is 180 pounds, and the push/drag/lift weight is 360. However, that's doubled for Large creatures. Thus an average Goliath can carry around all day 360 pounds, and in a pinch lift 720.
The average Gnome weighs 40 pounds. A Goliath would need an impossible -1 base strength plus the +2 racial mod to have a strength low enough to not be able to carry around a typical gnome all day.
It doesn't say anything about throwing, but I think we're in safe territory here.
yet the Gnome, following rules as written, can pin down a Goliath, fairly easily, if statted correctly.
Here, I take 'statted correctly' to mean a strength of 20. You can also get higher with the better Belts of Giant Strength, or by being a barbarian, but I'll stick with the 20.
Is there an in-universe explanation as to why such dramatically different sized creatures can wrestle on an even playing field?
Sure. A 'statted correctly' Gnome can feasibly lift and throw a Goliath.
From the same sources as our Gnome lifting above, a str 20 character (of any small or medium race) can freely carry around 300 pounds without breaking a sweat, and can push/drag/lift a whopping 600 pounds.
Goliaths weigh 280 to 340 pounds. Thus, a feasible grappling tactic for our diminutive grappler is what you might do with a child: pick him up. A somewhat lighter than average Goliath could be carried around all day, in case of emergencies.
Actually throwing the Goliath would be a DM judgement call. If you expand your range of opponents to other humanoids, you should have no trouble tossing around the heaviest humans (weight varies), elves (slender), half-orcs (bulky), tieflings (as humans), or even dragon born (250 pounds). However, it's essential to remember that even at only 150 pounds, nobody tosses a dwarf.
How might a DM explain a scenario in which a gnome beats a goliath in any kind of test of strength?
The Goliaths in question are average and run of the mill. Any gnome with a 20 strength is at least in the second tier (levels 5-10, PHB 15) and thus capable (with a few friends) of handling problems that threaten cities and kingdoms. Thus, such a Gnome is a pretty famous hero and a specimen as rare as any other character with a 20 in one stat.