If we’re really heading into the weeds, our Rennaisance forbears thought in terms of hexachords built on G C and F. To gain the leading tone into G (in whatever variety of contrapuntal situations it felt necessary) they borrowed F# from the hexachord built on D. D being to G as G is to C. They really did call it the third degree of D rather than half way between the fourth and fifth degrees in C! (just as they thought of b as the third degree of G rather than the seventh degree of C.
In the case of b and bb both were available - b was the third degree from G and bb the fourth from F. It’s an interesting scheme!