You are right that your paper may still be rejected, but you shouldn't worry too much. The fact that the editor proposed a resubmission suggests that he/she sees real value in it. As an editor, I can say that I would never waste time handling a submission again unless I thought there was a decent chance of acceptance.
Of course a decent chance is not 100%. Acceptance conditional on minor revisions means the editor is confident the revisions can be completed straightforwardly, while major revisions are always more of a gamble. They might just not work out in principle, or the authors might not be capable of pulling them off. However, they are worth a try.
Turning down an offer to resubmit is usually a mistake. It comes across as a sign of weakness, like you've decided your paper probably can't be fixed and you'd better just submit it somewhere less prestigious/demanding.
Also, what is the difference between "reject and resubmit" and "major revision required"?
Sometimes there's no difference at all: there are fields in which "reject and resubmit" is just what majors revisions are always called. Sometimes there's a difference, with reject and resubmit indicating a slightly less optimistic outlook (but still optimistic enough to be worth trying).
There are also borderline dishonest reasons some journals prefer reject and resubmit. Splitting a single submission into two submissions can make the journal look good in two different ways. Rejecting the initial submission decreases the journal's acceptance rate, which makes it look more selective. (A journal that accepts every submission after an R&R can claim it technically has an acceptance rate of 50% rather than 100%.) Furthermore, splitting the process in two decreases the average time from submission to a decision, which is another statistic authors care about.