They weren't "sure" of anything. You throw out a cliffhanger in the hopes it's enticing enough to be picked up, but unless you're already given a contract for seasons in advance, you don't know. Most adventure and sci-fi shows end in cliffhangers - rare for any to provide a true ending to the show.
Even a show is given a heads up that the next season will be its last, may still have a "hail mary" to a back door pilot, like Arrow. No harm to the creators of the content because if it gets picked up, you got some more paychecks coming and if doesn't, you didn't lose anything in the attempt (other than a few disgruntled viewers, which you were losing anyway).