For the most part, conservation of energy dictates that bodies in orbit will stay in orbit, and bodies transiting the system will exit it. Think of it like a ball rolling down a hill, then back up a hill of equal height. By rolling downhill, it gains enough velocity to make it back up the hill.
There are exceptions, of course. An asteroid passing through an atmosphere may be slowed down by friction (aerobraking), and be captured in orbit. Passing near another orbiting body, the interloper can be sped up or slowed down (gravity assist). But both of those require getting pretty close to a planet, and space is really big (citation needed), so it's unlikely that it would be captured.
Edit: Looks like I had the same misinterpretation, that it was a rogue planet rather than an Oort/Kuiper belt object.
There are exceptions, of course. An asteroid passing through an atmosphere may be slowed down by friction (aerobraking), and be captured in orbit. Passing near another orbiting body, the interloper can be sped up or slowed down (gravity assist). But both of those require getting pretty close to a planet, and space is really big (citation needed), so it's unlikely that it would be captured.
Edit: Looks like I had the same misinterpretation, that it was a rogue planet rather than an Oort/Kuiper belt object.