Y'all should read the article. It goes into more depth than these two comments! For example, two species can have sex, AND produce viable offspring, but NOT produce fertile offspring. Like a donkey and horse producing a typically infertile mule. Horses and donkeys are not the same species.
And sometimes you can have two things that everybody agrees are different species but which happily hybridize (with fertile offspring) all the time!