There's a lot of overlap between D&D and Pathfinder. Pathfinder was, originally, the D&D 3rd edition rule set copied and pasted, with a few nominal adjustments, into a book labeled "Pathfinder". This was legally permitted by the Open Game License. With D&D on its 5th edition (and heading toward its next incarnation), Pathfinder has released a 2nd edition of its own. It occurred to me that it might be interesting to compare the two from the perspective of building a character. Proceeding alphabetically, the next ancestry (or race in 5e) to cover are gnomes.
At the time of this writing, there's a new edition ("One D&D") on the distant horizon, and Tasha's Cauldron of Everything has established the "Custom Lineage" option that allows you to treat your choice of race a little like a costume. Players can have the flavour of a race without a penalty to speed, with a boost to any ability score, and so on. I'm not going to annotate possible exceptions to the rules in the 5e Player's Handbook.
Gnomes in the Forgotten Realms have no creation myth. They believe gnomes have always existed, and probably always will. Their primary god is Garl Glittergold, a golden-skinned fun-loving god who defeated Kurtulmak, the Kobold god.
While they tend to get along well with halflings, in many ways they have more in common with dwarves. The written gnomish language uses the dwarven alphabet, and gnomes tend to work and dwell underground. Of the two subraces offered in the 5e Player's Handbook, both are related to a subterranean life: rock gnomes and deep gnomes. Unlike the dwarves, however, gnomes view life as equal parts work and play, and one is just as important as the other.
The Dragonlance setting gave gnomes a unique spin that's had a pretty major influence on how gnomes are seen in D&D. Created by the god Reorx during some experiments, the gnomes of Krynn are seen by some as divine mistakes. Krynnish gnomes are tinkerers by default, inventors who believe that magic is just technology not yet understood. They each have a life quest, which they pursue obsessively once they figure out what it is (it's usually an invention.) Most gnomes dwell in Mount Nevermind, a subterranean facility for research and development. Gnomes of Krynn are responsible for inventing a time travel device, a flying ship that goes all the way to the moon Lunitari, the elevator (well, a gnomeflinger, anyway), and much more.
The gnomes of Pathfinder's Golarion are so far removed from the world's creation that they don't even actually belong on the material plane. They're fey creatures by nature, which makes them related to creatures like faeries and pixies and displacer beasts and blink dogs. Given this heritage, gnomes have a little inherent magic to them. A little like Dragonlance Kender, they're driven to explore and experiment and to experience new things. In fact, a gnome losing curiosity and wanderlust risks catching The Bleaching, a draining and withering disease that can lead to death. A gnome's life literally depends on activity and endless discovery.
It looks like you're getting a lot more with Pathfinder 2, but it's only because in 5e, ability scores are determined by dice rolls (or by assigning an array of pre-calculated numbers.) A single attribute boost is granted by your choice of race, but you've already boosted most of your scores above the base level of 10.
In Pathfinder 2, ability scores also start at 10, but instead of rolling die to affect them, you get boosts and flaws based on choices you make as you build your character. One of those choices is your ancestry, so you get several boosts and one flaw up front.
Both 5e and Pathfinder 2 gnomes are Small. 5e gnomes are said to stand from 2 to 3.5 feet tall, while Pathfinder 2 gnomes stand "just over 3 feet in height." So both are about a metre tall, on average.
Both systems account for the presumed length of your stride as a gnome. Interestingly, dwarves in Pathfinder 2 only get a speed of 20 feet, making the smaller gnomes faster than even a dwarf.
5e and Pathfinder 2 both grant gnomes the ability to see in some degree of darkness.
5e: Copy and pasted from the dwarf racial trait, gnomes have advantage on all Intelligence, Wisdom, and Charisma saving throws against magic.
P2: Nothing by default, unless you choose Illusion Sense as your 1st level ancestry feat. You gain a +1 bonus to Perception checks and Will saves against illusions.
I assume 5e gnomes are resistant to magic due to their relation to dwarves.
Golarion gnomes are historically fey creatures, so they have Illusion Sense available as an option. It's worth noting that Pathfinder 1st edition gnomes had that bonus automatically.
5e has two subraces. Pathfinder 2 has five heritages.
The 5e deep gnome and Pathfinder chameleon gnome both tie into the idea that gnomes (like halflings) are often "invisible" to big folk, either because they're just physically small and easy to literally overlook, or because they're underestimated.
The 5e rock gnome and Pathfinder umbral gnome both address the underground gnome archetype.
Two of the other Pathfinder 2 heritages address the magical nature of Golarion gnomes:
Finally, the fifth Pathfinder 2 heritage helps you build a gnome who's attuned to the material plane. This feels pretty arbitrary to me, and I'm not sure what lore it ties back to, but arbitrary can be fun.
Broadly, there seem to be two types of gnomes. There are the underground worker gnomes, and the tinker gnomes, and the two aren't always distinct from one another. In both systems, gnomes are considered early creations that are just a little out of place in the fantasy-modern times of Toril, Krynn, and Golarion. In each case, the implication is that gnomes were sort of concept art for a different iteration of reality, but accidentally got put into a later iteration anyway. It's a fun and weird concept, and you can play up any of the different gnomish aspects, and that's well supported by the character build process of both systems. Build a magical explorer, a shadowy underground tinkerer, a magical tinkerer, an artist of clockwork gadgets. Whatever you build, a gnome is up for adventure, and a lot of fun to play.