Dynamical evolution of NEAs: Close encounters, secular perturbations and resonances