Recent numerical results on advection dynamics have shown that particles denser than the fluid can remain trapped indefinitely in a bounded region of an open fluid flow. Here, we investigate this counterintuitive phenomenon both numerically and analytically to establish the conditions under which the underlying particle-trapping attractors can form. We focus on a two-dimensional open flow composed of a pair of vortices and its specular image, which is a system we represent as a vortex pair plus a wall along the symmetry line. Considering particles that are much denser than the fluid, referred to as heavy particles, we show that two attractors form in the neighbourhood of the vortex pair provided that the particle Stokes number is smaller than a critical value of order unity. In the absence of the wall, the attractors are fixed points in the frame rotating with the vortex pair, and the boundaries of their basins of attraction are smooth. When the wall is present, the point attractors describe counter-rotating ellipses in this frame, with a period equal to half the period of one isolated vortex pair. The basin boundaries remain smooth if the distance from the vortex pair to the wall is large. However, these boundaries are shown to become fractal if the distance to the wall is smaller than a critical distance that scales with the inverse square root of the Stokes number. This transformation is related to the breakdown of a separatrix that gives rise to a heteroclinic tangle close to the vortices, which we describe using a Melnikov function. For an even smaller distance to the wall, we demonstrate that a second separatrix breaks down and a new heteroclinic tangle forms farther away from the vortices, at the boundary between the open and closed streamlines. Particles released in the open part of the flow can approach the attractors and be trapped permanently provided that they cross the two separatrices, which can occur under the effect of flow unsteadiness. Furthermore, the trapping of heavy particles from the open flow is shown to be robust to the presence of viscosity, noise and gravity. Navier–Stokes simulations for large flow Reynolds numbers show that viscosity does not destroy the attracting points until vortex merging takes place, while simulation of thermal noise shows that particle trapping persists for extended periods provided that the Péclet number is large. The presence of a gravitational field does not alter the permanent trapping by the attracting points if the settling velocities are not too large. For larger settling velocities, however, gravity can also give rise to a limit-cycle attractor next to the external separatrix and to a new form of trapping from the open flow that is not mediated by a heteroclinic tangle.