The role of habitat selection behavior in population dynamics: source–sink systems and ecological traps