We use this expression to sound hopeful after two negative or unlucky experiences.
我们用这个短语表达在经历了两次消极或不幸的经历后第三次更有希望成功。
It seems likely that it is just a folk belief that we ought to persevere and not give up. Three seems to be the right number of times to try. Two isn't enough but four is too many. Think of every time you've seen a drama in which a character tries to unlock a door with an set of unfamiliar keys. The first key fails, the second key fails - it is always the third that works.