No doubt paquda is correct in saying that it's a case of ktiv and keri, but it will rarely have vowels exactly of elohim or exactly of adonai. Every case the vowels are either like elohim or like adonai. But rarely exactly like.
A) When it(YHVH) has vowels like Adonai, the difference is that there is usually a simple shva under the Yud rather than a composite shva. (at least looking at the WLC)
B) When it(YHVH) has vowels like Elohim, the difference is that in most cases there is a simple shva under the yud of YHVH.
C) Usually there is no cholam on the vav of YHVH(funnily enough mechon mamre's text never puts the cholam on there, and bible.ort.org's text has the cholam on all of them. The WLC has a mixture, where thousands of cases don't have the vav and around 50-90 do)
And interestingly, in WLC, for Judges 16:28 you get a composite shva under the yud, and a vav over the first heh, so the vowels (hataph segol, cholam, chirik), are exactly the vowels of elohim, in that instance. (I don't think there is any case in the WLC, of YHVH matching the vowels of adonai or elohim exactly, other than that one where it matches elohim exactly).
The reason for the composite shva(on the aleph of elohim and of adonai), changed to a simple shva(on the yud of YHVH), is likely because(or at least something to do with the fact that), yud is allowed a simple vocal shva. (unlike aleph, which is in adonai and elohim, an aleph's vocal shva has to be composite).
i.e. grammatically a gutteral e.g. Aleph, isn't meant to take a simple vocal shva but can take a composite shva, so adonai and elohim take a composite shva. So it's normal for a letter that would normally take a simple vocal shva, to take a composite shva if the letter is gutteral. (Note that there are cases of non-gutteral letters in tanach taking composite shva too) Yud doesn't have that restriction that aleph has of not being able to take a simple vocal shva.
The answerer, Pekuda, does explain when YHVH has the vowels like Adonai and when it has the vowels like Elohim. (I say like adonai and like elohim, rather than 'of' adonai and elohim, because see points A,B,C).
His answer does leave open the question of why is it that sometimes the cholam is in there, (i.e. the cholam of elohim and adonai), leaving all the vowels in there, and sometimes not. And indeed sometimes with the vowels like in the WLC, elohim(1 Kings 2:26, Psalms 140:8, Isaiah 50:4), and sometimes with the vowels like adonai(Gen 3:14, Gen 9:26).
Note- if you have a text editor with regex search and the tanach loaded in, you can use the regex
[\u05D9][\u0500-\u05AF\u05BC-05CF]*[\u05B0-\u05BB][\u0500-\u05AF\u05BC-05CF]*[\u05D4][\u0500-\u05AF\u05BC-05CF]*[\u05B0-\u05BB][\u0500-\u05AF\u05BC-05CF]*[\u05D5][\u0500-\u05AF\u05BC-05CF]*[\u05B0-\u05BB][\u0500-\u05AF\u05BC-05CF]*[\u05D4] to search for e.g. YHWH with cholam.
Note- It may be a bit flawed to look to the WLC for something as fine as this, (As the leningrad is thought to be a bit sloppy and doesn't even correspond with its own mesora notes in its markings), perhaps the Aleppo Codex sheds more light, though it isn't in digital text form and may just be in pdf or jpg which makes it harder to check).