There are three kinds of trigger, not one
Apps Script has three trigger mechanisms and they are not interchangeable. A simple trigger is a function with a reserved name — onOpen, onEdit, onSelectionChange — that Google runs automatically. An installable trigger is one you attach by hand (the clock icon in the editor, or ScriptApp in code) to any function you like. A time-driven trigger is an installable trigger fired on a schedule instead of by an event.
Most tutorials show you an onEdit function, tell you it runs when the sheet changes, and stop there. That works right up until your onEdit needs to send an email or read another file — and then it silently does nothing, with no error, and you lose an evening.