The last move that hits em basically determines it. Some characters have a fatter hitbox on the ground than others, so something like Hisui 2a will whiff one guy and hit the other off the ground. Also, when the opponent first hits the ground, they have a slight bounce, which makes their hitbox easier to OTG(since they're still bouncing kinda).
Also remember there's a standard limit of 2 OTG/Wall slams before they become invincible. So if you do say, 2c623b(slam 1) 2c623b(slam 2) 2c623b(slam 3, opponent invulnerable), you can't OTG them after that. However if you do say, 2c623b(slam 1) 2c4c jab jabc(slam 2), you will be able to OTG them since they have only been hit off the ground twice.