Primordial black hole evaporation and dark matter production. II. Interplay with the freeze-in or freeze-out mechanism