Trey asked to be traded to some team where he'd have a shot at the #2 QB job, and the Cowboys ponied up with the 4th round 2024 pick, and the 49ers agreed with the trade.
The higher the pick, the higher the odds that QB is going to a crap-ass team, so unless the QB goes to a team with a good surrounding cast (and committed team identity on offense), they will be so-so. Or if you can take raw talent like Josh Allen and give them 3 solid years of being coached up...