Anfonwch hwn fel neges destun: The environment and redshift dependence of accretion onto dark matter halos and subhalos