The expression "a close-run thing" means that something was very uncertain or could have gone either way but was ultimately successful or narrowly avoided failure. This is often used to describe situations in which the outcome was not obvious or certain beforehand, such as a close sports match or a narrowly-won election. It can also be used in other contexts where there was a possibility of failure or success and the result was not decided until the very end.