When an asteroid enters the sphere of influence of a planet and the periapsis is above the atmosphere (if it wasn't and the object doesn't leave the atmosphere at escape velocity, the object would eventually fall back to the planet), how can it go into an orbit? If it wasn't slowed down, wouldn't it have to leave the sphere of influence with the same velocity as it entered it? And if it was slowed down, how did that happen?
The short of it is, because gravity is a complex interaction between thousands of objects rather than the simple two body problems commonly presented. The influences of some distant world could apply the proper mild braking force at the right moment, and there you are.
Wikipedia has an article on captures without insertion burns, or ballistic capture. One scenario described is entering an orbit just below the orbit of the body you wish to transfer to, and letting it's gravity pull you in as it approaches from behind. This leaves you in a very high orbit of the body that caught up to you, but evidently isn't stable. As a navigational tool it doesn't seem very practical, but it could explain the temporary capture of asteroids by a planet.
2006 RH120 got captured by Earth in 2006 through the Earth-Sun L2 point. It completed a few orbits before escaping in the general direction of L1. This is an example of a ballistic capture.
Here is a simulation of this event that will run in your browser. Earth is held stationary in a rotating frame to make it easier to visualize the orientation of the Lagrange points. You can tell the direction to the Sun by the phases of the objects: http://orbitsimulator.com/gravitySimulatorCloud/simulations/1517087032751_2006RH120.html