"Ersatz" is used both in the sense of replacement/spare as well as substitute/not genuine.
A "Ersatzrad" is a spare tire/wheel, while "Ersatzkaffe" or "Kaffeersatz" refers to a coffee substitute, i.e. malt coffee/Ovaltine. Another meaning is reimbursement, i.e. for damages: "Schadensersatz."
HTH