Sequels and Trilogies

For writers working on series: what signs in your story told you it needed a sequel? I’m curious how people determine that before finishing the first book. I’ve noticed some writers start thinking about book two fairly early, and it made me wonder how that decision usually happens.