The 3DS games have a GTS and online trading & battling like in DP. They also have Wonder Trade, where you pick a Pokemon to trade and swap it with a random person’s Pokemon.
In terms of popularity X & Y sold the most (16.42 million), followed closely by Sun & Moon (16.17 million), then OmegaRuby & AlphaSapphire (14.23 million), then Ultra Sun & Ultra Moon (8.57 million).
The Sun & Moon games are newer. Original SM has a better story but Ultra SM has more Pokemon and sidequests.
The Gen 6 games may be better for Dex completionists. If you own all four (X, Y, OmegaRuby, and AlphaSapphire) and can trade with yourself you can get every non-mythical Pokemon. The Gen 7 games have a lot of Pokemon, but there are still some that you can’t get unless you upload them through Pokemon Bank (a subscription-based cloud storage on 3DS) or trade for them.