Yes. You’re randomly matched with another person who stuck something into the random trade system and it swaps your pokemon
Chance plays into this quite a bit, but also some of the pokemon you’re getting may well not be as bad as you think, they might just need levelling up.
You’ve said before sometimes it sounds like we’re talking like another language - there’s a term called IV that’s come up a lot and no-one’s ever explained;
Every Pokemon has 6 Individual Values (IVs) that are hidden stats ranging from 1-32. Each one of these is tied to the normal stats; HP, Attack, Speed, Defend and the 2 SP ones and gives that stat a boost.
In the end game, there’s an item called the IV checker that gives you access to a new screen for you poke that looks like this

It basically shows you the hidden values as text.
Some of those pokes you’ve been getting will have several “Best” or as we’ve been calling them MAX IVs, but you can’t tell at the moment. They’re the most powerful they can be in those stats for their current level.