The history.push() method adds a new entry to the history stack, while the history.replace() method replaces the current entry.