A comparative study of intervening and associated H I 21-cm absorption profiles in redshifted galaxies