Most institutions have an internal database of previously submitted student papers. Turnitin can check for self-plagiarism by comparing your paper against this database. If you’ve reused parts of an assignment you already submitted, it will flag any similarities as potential plagiarism.
Online plagiarism checkers don’t have access to your institution’s database, so they can’t detect self-plagiarism of unpublished work. If you’re worried about accidentally self-plagiarizing, you can use Scribbr’s Self-Plagiarism Checker to upload your unpublished documents and check them for similarities.